赞
踩
npm install vue-i18n@9
export default {
common: {
input_placeholder: 'Please Input',
select_placeholder: 'Please Select',
search: 'Search',
reset: 'Reset',
edit: 'Edit',
delete: 'Delete',
delete_tip: 'Are you sure to delete this?',
confirm: 'Confirm',
cancel: 'Cancel'
}
}
export default {
common: {
input_placeholder: '请输入',
select_placeholder: '请选择',
search: '查询',
reset: '重置',
edit: '编辑',
delete: '删除',
delete_tip: '确认删除?',
confirm: '确定',
cancel: '取消'
},
}
import { createI18n } from 'vue-i18n'; import { createPinia } from 'pinia'; import en from './en' import zh from './zh'; import SettingsStore from '@/store/settings'; const settings = SettingsStore(createPinia()) export const i18n = createI18n({ locale: settings.lang, // fallbackLocale: 'en', legacy: false, // Composition API 模式 globalInjection: true, // 全局注册 $t方法 messages: { en: en, zh: zh } })
import { i18n } from '@/i18n';
app..use(i18n).mount('#app')
<a-button type="text" danger>{{$t('common.delete')}}</a-button>
import { i18n } from '@/i18n'
const { t } = i18n.global
export const nav = [
{
title: t('nav.shop.shop_management'),
icon: 'power',
children: [
{
title: t('nav.shop.account_list'),
path: 'account-list'
},
]
},
]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。