您现在的位置是:网站首页> 编程资料编程资料
vue中实现可编辑table及其中加入下拉选项_vue.js_
2023-05-24
308人已围观
简介 vue中实现可编辑table及其中加入下拉选项_vue.js_
可编辑table及其中加入下拉选项
{{scope.row.name}} {{scope.row.age}} {{scope.row.address}} {{scope.row.stu}} 编辑 保存
可以通过设置js里的show:true让该行处于默认编辑状态
出来效果图

vue表头下拉选择框使用总结
1.在el-table-culumn中,加入template标签
使用:
类型 (表中元素)//这里,会出现一个bug,下文有解决办法 属性0 属性1 属性2 属性3 属性4 属性5 属性6
2.设置handleCommand方法
(当时没使用handleCommand方法做缓冲,在刷新时,第一次刷新不会赋值,第二次刷新会得到上次刷新的值。)
handleCommand(command) { if(command == '属性0' ){ this.sx= '0' } else if (command === '属性1') { this.sx = '1' } else if( command === '属性2') { this.sx = '2' } else if (command === '属性3') { this.sx = '3' } else if (command === '属性4') { this.sx = '4' } else if( command === '属性5') { this.sx = '5' } else if (command === '属性6') { this.sx = '6' } this.刷新方法; },但是在使用过程中,点击下拉框中数据时,会出现执行两次handleCommand()方法的情况。通过一天的询问与查找,得到解决办法。
问题出现在
所以,应该去掉
类型 (表中元素)属性0 属性1 属性2 属性3 属性4 属性5 属性6
以上为个人经验,希望能给大家一个参考,也希望大家多多支持。
您可能感兴趣的文章:
