组件中的Vue i10n

时间:2019-03-07 04:17:38

标签: vue.js locale

我使用了插件vue i18n。代码示例:

<template>
    <div>
        {{ test }}
    </div>
</template>

<script>
    export default {
        layout: "default",
        label: this.$t('Tools'),

        data: () => ({
            test: this.$t('Test')
        })
    }
</script>

但是它不起作用。该插件尚未初始化,因此无法转换字符串。这个问题有解决方案吗?

0 个答案:

没有答案