mirror of https://gitee.com/xiaonuobase/snowy
feat: 为组件STable的标题加上多国语言功能
parent
8db2dab751
commit
064a7bc127
|
@ -4,6 +4,9 @@
|
||||||
import draggable from 'vuedraggable-es'
|
import draggable from 'vuedraggable-es'
|
||||||
import columnSetting from './columnSetting.vue'
|
import columnSetting from './columnSetting.vue'
|
||||||
import './index.less'
|
import './index.less'
|
||||||
|
import i18n from '@/locales'
|
||||||
|
|
||||||
|
const {t} = i18n.global
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'STable',
|
name: 'STable',
|
||||||
|
@ -155,7 +158,13 @@
|
||||||
false
|
false
|
||||||
this.needTotalList = this.initTotalList(this.columns)
|
this.needTotalList = this.initTotalList(this.columns)
|
||||||
this.loadData()
|
this.loadData()
|
||||||
this.columnsSetting = this.columns
|
this.columnsSetting = this.columns.map(c => {
|
||||||
|
const tt = c.title
|
||||||
|
if (typeof tt === "string") {
|
||||||
|
c.title = () => t(tt)
|
||||||
|
}
|
||||||
|
return c
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue