组件用的s-table, 在国际化的时候必须页面刷新表头才会跟着刷新,有其他处理方式吗
gouyuwang opened this issue · 3 comments
gouyuwang commented
columns: [
{
title: this.$t('activity.list.name'),
dataIndex: 'name'
},
····
]
DogeLasVegas commented
同问,现在有什么解决办法吗
DogeLasVegas commented
搜到一种办法:
<template v-for="(item, index) in columns" :slot="item.slotName">
<span :key="index">{{ $t(item.slotName) }}</span>
</template>
{
slotName: 'table.column.id',
dataIndex: 'id',
width: '185px',
scopedSlots: { customRender: 'serial', title: 'table.column.id' },
},
这样可以实现自动刷新
DogeLasVegas commented
还有一种:
columns: [
{
title: () => this.$t('table.serial'),
scopedSlots: { customRender: 'serial' }
}
]