element UI el-table 表格的 slot-scope=“scope“插槽不生效

不生效的插槽是这样的

复制代码
<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"属性】 。就可以了。

 

posted @   当下是吾  阅读(1934)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
点击右上角即可分享
微信分享提示