add vxe-table i18n
This commit is contained in:
parent
898f819c5f
commit
e3a7be0382
|
@ -2,12 +2,14 @@ import Vue from 'vue'
|
||||||
import VueI18n from 'vue-i18n'
|
import VueI18n from 'vue-i18n'
|
||||||
import elenUS from 'element-ui/lib/locale/lang/en'
|
import elenUS from 'element-ui/lib/locale/lang/en'
|
||||||
import elzhCN from 'element-ui/lib/locale/lang/zh-CN'
|
import elzhCN from 'element-ui/lib/locale/lang/zh-CN'
|
||||||
|
import vxeEnUS from 'vxe-table/lib/locale/lang/en-US'
|
||||||
|
import vxeZhCN from 'vxe-table/lib/locale/lang/zh-CN'
|
||||||
import storage from '@/common/storage'
|
import storage from '@/common/storage'
|
||||||
Vue.use(VueI18n)
|
Vue.use(VueI18n)
|
||||||
|
|
||||||
const languages = [
|
const languages = [
|
||||||
{value: 'en-US', label: 'English', el: elenUS},
|
{value: 'en-US', label: 'English', el: elenUS, vxe: {...vxeEnUS}},
|
||||||
{value: 'zh-CN', label: '简体中文', el: elzhCN},
|
{value: 'zh-CN', label: '简体中文', el: elzhCN, vxe: {...vxeZhCN}},
|
||||||
]
|
]
|
||||||
const messages = {}
|
const messages = {}
|
||||||
|
|
||||||
|
@ -16,7 +18,7 @@ for (let lang of languages) {
|
||||||
let locale = lang.value
|
let locale = lang.value
|
||||||
let m = require(`./oj/${locale}`).m
|
let m = require(`./oj/${locale}`).m
|
||||||
Object.assign(m, require(`./admin/${locale}`).m)
|
Object.assign(m, require(`./admin/${locale}`).m)
|
||||||
let ui = Object.assign({}, lang.el)
|
let ui = Object.assign(lang.vxe, lang.el)
|
||||||
messages[locale] = Object.assign({m: m}, ui);
|
messages[locale] = Object.assign({m: m}, ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import Md_Katex from '@iktakahiro/markdown-it-katex'
|
||||||
|
|
||||||
// 注释表示使用cdn引入
|
// 注释表示使用cdn引入
|
||||||
// import 'xe-utils'
|
// import 'xe-utils'
|
||||||
// import VXETable from 'vxe-table'
|
import VXETable from 'vxe-table'
|
||||||
// import 'vxe-table/lib/style.css'
|
// import 'vxe-table/lib/style.css'
|
||||||
|
|
||||||
import Katex from '@/common/katex'
|
import Katex from '@/common/katex'
|
||||||
|
@ -69,7 +69,11 @@ Object.keys(filters).forEach(key => { // 注册全局过滤器
|
||||||
})
|
})
|
||||||
Vue.use(VueParticles) // 粒子特效背景
|
Vue.use(VueParticles) // 粒子特效背景
|
||||||
Vue.use(Katex) // 数学公式渲染
|
Vue.use(Katex) // 数学公式渲染
|
||||||
// Vue.use(VXETable) // 表格组件
|
VXETable.setup({
|
||||||
|
// 对组件内置的提示语进行国际化翻译
|
||||||
|
i18n: (key, value) => i18n.t(key, value)
|
||||||
|
})
|
||||||
|
Vue.use(VXETable) // 表格组件
|
||||||
Vue.use(VueClipboard) // 剪贴板
|
Vue.use(VueClipboard) // 剪贴板
|
||||||
Vue.use(highlight) // 代码高亮
|
Vue.use(highlight) // 代码高亮
|
||||||
Vue.use(Element,{
|
Vue.use(Element,{
|
||||||
|
|
|
@ -231,7 +231,9 @@
|
||||||
}}+</template
|
}}+</template
|
||||||
>{{ row.submissionInfo[problem.displayId].tryNum
|
>{{ row.submissionInfo[problem.displayId].tryNum
|
||||||
}}{{
|
}}{{
|
||||||
row.submissionInfo[problem.displayId].tryNum > 1
|
row.submissionInfo[problem.displayId].errorNum +
|
||||||
|
row.submissionInfo[problem.displayId].tryNum >
|
||||||
|
1
|
||||||
? ' tries'
|
? ' tries'
|
||||||
: ' try'
|
: ' try'
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in New Issue