Looking for a solution to localize the default value of a component prop using vue-i18n
. Here's an example:
export default {
name: 'ExampleComponent',
props: [{
prompt: {
required: false,
type: String,
default: $t('example.prompt.default')
}]
}
While trying to access $t
within the default value, it seems that neither $t
nor this.$t
is available in that context. Any suggestions on how to properly translate the default
value for a prop using VueI18n?