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

希望能尽快解决vxe-table-column自定义渲染问题,谢谢大佬! #15

Open
waveheart opened this issue Sep 16, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@waveheart
Copy link

(必填)这个需求解决了什么问题:
vxe-table-column自定义渲染问题
cell内部内容可以自定义渲染

建议的 API 是什么样的:
与 vxe-table-column相同

是否已有其他不错的替代方案:

@waveheart waveheart added the enhancement New feature or request label Sep 16, 2020
@Charlie50503
Copy link

請問一下
目前使用這個虛擬tree插件的話
一定要使用columns這個props 才可以渲染出來
而使用一般的自定義形式
<vxe-table-column type="radio" title="radio" width="80"></vxe-table-column>
就無法使用

請問是這個意思嗎?

@Charlie50503
Copy link

目前我能想到的客製化方式是利用渲染html配合
vxe-table-column的formatter props來達到客製化的效果,希望能有所幫助

//columns 設定
tableColumn: [
        { type: 'radio', title: 'radio'},
        { field: 'label', title: 'label', treeNode: true },
        { field: 'role', title: 'role' },
        {
          field: 'seq_no',
          title: 'seq',
          type: 'html',
          formatter: this.seqFormatter
        }
      ],

//methods
seqFormatter(payload) {
      if (payload.active_flag === true) {
        return `<span class='font-weight-bold'>${payload.cellValue}</span>`
      } else {
        return `<span class=''>${payload.cellValue}</span>`
      }
    },

@xlz26296
Copy link

本来就可以自定义插槽
https://xuliangzhan_admin.gitee.io/vxe-table/#/table/grid/template

@Charlie50503
Copy link

@xlz26296 你所提供的連結是用vxe-grid實現的
並不是用vxe-table實現的喔

@es3154
Copy link

es3154 commented Jan 28, 2021

@Charlie50503 同问

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants