这篇文章主要介绍了优雅的elementUI table单元格可编辑实现方法详解,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
最近在做可编辑特定列的单元格的elementUI table,看了N多的开源、文章,找到一个很优雅的实现方式,分享给大家。
PS:单元格可编辑的table,用英文搜索:Inline editable table with ElementUI 会得到高质量结果。
先上
APP.vue:
<div id="app"> <div style="margin-bottom: 30px"> </div> <span>{{row.name}}</span> {{row.gender === 'M' ? 'Male': 'Female'}} <span>{{row.date<em style="color:transparent">本文来源[email protected]搞@^&代*@码)网9</em>}}</span></div> .edit-cell { min-height: 35px; cursor: pointer; }
EditeableCell.vue:
<div class="edit-cell"> <div class="cell-content"> </div> </div> .cell-content { min-height: 40px; padding-left: 5px; padding-top: 5px; border: 1px solid transparent; } .edit-enabled-cell { border: 1px dashed #409eff; }
github:https://github.com/heianxing/editable-table-idea-vue-element
另外一个单元格编辑的例子:
App.vue:
<div id="app"> <i class="el-icon-info"></i> <span>{{row.name}}</span> {{row.gender === 'M' ? 'Male': 'Female'}} <span>{{row.date}}</span></div> .edit-cell { min-height: 35px; cursor: pointer; }
EditeableCell.vue:
<div class="edit-cell"> <div> </div> </div>
github:https://github.com/heianxing/editable-table-component-vue-element
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持gaodaima搞代码网。
以上就是优雅的elementUI table单元格可编辑实现方法详解的详细内容,更多请关注gaodaima搞代码网其它相关文章!