I am trying to establish a default property from a dictionary in this way:
props: {
title: {
type: String,
default: this.$t("basic.confirm"),
},
description: {
type: String,
}
}, ...
The $t
function is part of the vue-i18n library, and my goal is to set the title using a value from the dictionary if it is not defined in the parent class. However, I encountered an error:
Uncaught TypeError: this.$t is not a function
A similar error occurs when I remove 'this' while reloading.
Uncaught ReferenceError: $t is not defined
Interestingly, logging out this value in the mount method works without any issues.
Is there a solution for setting a default property from the dictionary?
Thank you in advance!