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

[vue] ElementUI表格组件如何实现动态表头? #398

Open
haizhilin2013 opened this issue Jun 20, 2019 · 4 comments
Open

[vue] ElementUI表格组件如何实现动态表头? #398

haizhilin2013 opened this issue Jun 20, 2019 · 4 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] ElementUI表格组件如何实现动态表头?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 20, 2019
@wenyejie
Copy link

收集到子组件的依赖, 并实施watch, v-for生成.

PS: 没研究过他的源码, 主观臆想, 大概是这样

@forever-z-133
Copy link

使用自定义表头,即 <el-table-column> 中传入自定义 slot
表头整体结构变化则得自己 v-for 表头配置拼 <el-table-column> 重绘

@tustzdm
Copy link

tustzdm commented Nov 16, 2019

<template v-for="item in tableColownms"> <el-table-column v-if="item.type!='hidden'" :key="item.id" :prop="item.field" sortable :label="item.label"> </template>
不用template包裹也行

@Bob-huang-gdut
Copy link

table头部自定义 使用el-table-column中的:render-header 里面的处理用 render函数渲染
table头部对应的data数据自定义 使用Vue插槽:scopedSlot属性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

5 participants