element UI el-table 表格的 slot-scope=“scope“插槽不生效
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
·
element UI el-table 表格的 slot-scope="scope"插槽不生效
https://segmentfault.com/q/1010000018712853
// 不生效的插槽是这样的
<el-table-column align="center" prop="position" width="270" label="位置">
<template slot-scope="scope">
<div class="change-position">
1111111
<el-input
style="text-align:center"
v-if="scope.row.positionEdit"
v-model="scope.row.position"
></el-input>
<span v-else>{{scope.row.position}}</span>
</div>
</template>
</el-table-column>
这个其实换一种写法也可以实现。template 里面的属性改为 #default=“scope”。 重点:【template外围标签el-table-column 加上 key="slot"属性】 。就可以了。

A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:3 个月前 )
c345bb45
7 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 7 个月前
更多推荐

所有评论(0)