Options

Compilation

Vue I18n message format compile options.

compilation

  • type: object
  • default: { strictMessage: true, escapeHtml: false }

Configure flags that sets the behavior compilation of locale messages.

Supported properties:

strictMessage

  • type: boolean
  • default: true

Strictly check that the locale message does not contain HTML tags. If HTML tags are included, an error is thrown.

If you do not want the error to be thrown, you can work around it by setting it to false. However, this means that the locale message might cause security issues with XSS. In that case, we recommend setting the escapeHtml option to true.

escapeHtml

  • type: boolean
  • default: false

Determine whether to escape HTML tags if they are included in the locale message.

If strictMessage is disabled by setting it to false, we recommend enabling this option.

Copyright © 2024