Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

组件用的s-table, 在国际化的时候必须页面刷新表头才会跟着刷新,有其他处理方式吗 #1452

Open
gouyuwang opened this issue Jun 3, 2024 · 3 comments
Labels
question Further information is requested

Comments

@gouyuwang
Copy link

  columns: [
        {
          title: this.$t('activity.list.name'),
          dataIndex: 'name'
        },
        ····
]
@gouyuwang gouyuwang added the question Further information is requested label Jun 3, 2024
@gouyuwang gouyuwang reopened this Jun 3, 2024
@DogeLasVegas
Copy link

同问,现在有什么解决办法吗

@DogeLasVegas
Copy link

DogeLasVegas commented Jul 17, 2024

搜到一种办法:

<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
Copy link

还有一种:

columns: [
  {
    title: () => this.$t('table.serial'),
    scopedSlots: { customRender: 'serial' }
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants