element-ui opens the el-dialog pop-up window, which will change the data of the el-table table

When element-ui opens the el-dialog pop-up window, it will change the data object
assignment object of the el-table form this.form = row, and assign the 'address' when assigning a value, that is, the two variables after assignment refer to the same one in the stack The memory address, the two variables will affect each other, the data of one variable will change, and the data of the other will also change.

Deep copy processing data

<el-table-column label="操作">
      <template slot-scope="scope">
        <el-button size="mini" @click="handleEdit(scope.row)">查看</el-button>
       </template>
    </el-table-column>
//查看功能
handleEdit(row) {
 this.form = JSON.parse(JSON.stringify(row));//this.form为表单数据,row是表格的某一行
}

Guess you like

Origin blog.csdn.net/qq_38881495/article/details/130196087