【发布时间】:2018-11-18 11:26:22
【问题描述】:
我正在使用 vue-good-table 来渲染表格。
<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'
}
]
无论如何我可以在标签参数中使用例如 {{ $t("column.date") }} 。直到现在它只在传递字符串时才有效?
添加更多代码:
main.js 常量 i18n = 新的 VueI18n({ locale: 'bg', // 设置语言环境 fallbackLocale: 'bg', messages // 设置区域信息 });
Vue.prototype.$locale = {
change (lang) {
i18n.locale = lang
},
current () {
return i18n.locale
}
}
【问题讨论】:
标签: vue.js internationalization