Vue.js VueI18n在自定义表VueJS中传递字符串
我正在使用vue good table渲染表Vue.js VueI18n在自定义表VueJS中传递字符串,vue.js,internationalization,Vue.js,Internationalization,我正在使用vue good table渲染表 <vue-good-table :columns="columns" :rows="items" :paginate="true" :lineNumbers="true"> </vue-good-table> columns: [ { label: 'Date', field: 'date', t
<vue-good-table
:columns="columns"
:rows="items"
:paginate="true"
:lineNumbers="true">
</vue-good-table>
columns: [
{
label: 'Date',
field: 'date',
type: 'String',
filterable: true,
placeholder: 'Date'
}
]
列:[
{
标签:this.$t(“column.date”),
字段:“日期”,
键入:“字符串”,
可过滤:正确,
占位符:“日期”
}
]
输出为“column.date”,它不是那样工作的。它没有显示真正的消息哦,是的,谢谢,我犯了一个打字错误,但是语言之间的切换对这个组件不起作用。当我点击英语/保加利亚语按钮时,它停留在保加利亚语(默认选项)上。事实上,它确实改变了语言。然而,除了表格之外,它在任何地方都会改变语言。有什么解决办法吗?
Vue.prototype.$locale = {
change (lang) {
i18n.locale = lang
},
current () {
return i18n.locale
}
}