element icon indicating copy to clipboard operation
element copied to clipboard

el-table 修改行数据,不能及时更新,要缩放浏览器才有效果 "element-ui": "^1.2.3"

Open onforyou opened this issue 9 years ago • 1 comments

el-table 修改行数据,不能及时更新,要缩放浏览器才有效果,

    <el-table-column label="操作" fixed="right">
      <template scope="scope">
        <el-button
          size="small"
          type="info"
          @click="handleEdit(scope.$index, scope.row)" v-if="!scope.row.edit" >编辑
        </el-button>
        <el-button
          size="small"
          type="info"
          @click="handleSave(scope.$index, scope.row)" v-if="scope.row.edit==1" >保存
        </el-button>
      </template>

  handleEdit(index, row){
      row.edit = 1;
  },
  handleSave(index, row){
    row.edit = 0
  }

需求是,编辑行数据,“编辑”和"保存"按钮互斥

onforyou avatar Mar 07 '17 12:03 onforyou

是vue特性的问题,用 $set() 或 vue 包装过的变异方法。 http://cn.vuejs.org/guide/list.html#%E5%8F%98%E5%BC%82%E6%96%B9%E6%B3%95

onforyou avatar Mar 07 '17 13:03 onforyou