I would like to set a default property from dictionary like this:
props: {
title: {
type: String,
default: this.$t("basic.confirm"),
},
description: {
type: String,
}
}, ...
The $t
is a vue-i18n, and I would like to set my title from dictionary, if its not defined in the parent class. But I got error:
Uncaught TypeError: this.$t is not a function
Similar error If I reload without this
.
Uncaught ReferenceError: $t is not defined
But If I log out this value in the mount method it works well.
Is there a solution of setting default property from the dictionary?
Thanks in advance!