AVUE Add your own operations before clicking the edit button to pull up the pop-up window

1. Custom edit button event

<avue-crud
          ref="crud"
          :data="data"
          v-model="form"
          :option="option"
          :page.sync="page"
          @on-load="getList"
          @refresh-change="refreshChange"
          @search-reset="from = {}"
          @search-change="searchChange"
          @row-update="rowUpdate"
          @row-save="rowSave"
          @row-del="rowDel"
      >
        <template slot="menuLeft">
          <el-tag type="danger" ><b> 注:我太难了</b></el-tag>
        </template>
        
        <template slot-scope="scope"
                  slot="menu">
          <el-button size="small"
                     type="success"
                     icon="el-icon-edit"
                     @click="updateButtonClick(scope.row,scope.index)">编 辑
          </el-button>
          <el-button size="small"
                     type="danger"
                     icon="el-icon-delete-solid"
                     @click="$refs.crud.rowDel(scope.row,scope.index);">删 除
          </el-button>
        </template>

      </avue-crud>

2. In the custom edit button click event, process the logic, and finally pull up the edit page

  methods: {
    //跳转
    updateButtonClick(row,index) {
      //↓↓↓此处写自己的逻辑

      //↑↑↑此处写自己的逻辑
      console.log(row);
      this.$refs.crud.rowEdit(row, index);
    }
  },

Guess you like

Origin blog.csdn.net/qq_37928038/article/details/125660020