表格中平时显示是span 点击之后变为input
<span v-if="!editing" @click="edit()" >{{item.wenzi}}</span> <input type="text" v-el:input v-if="editing" v-on:keyup.enter="blur()" value="{{item.wenzi}}" v-model="item.wenzi" >
methods: { blur: function () { this.editing = false }, edit: function () { this.editing = true this.$nextTick(function () { this.$els.input.focus() }) },
慕妹3242003
相关分类