runtime-core.esm-bundler.js?5c40:6748 Uncaught TypeError: Cannot create property ‘id‘ on number ‘0‘

 <template #default="scope">
                    <el-button size="mini" @click="handleEdit(scope.$index,scope.row)">编辑el-button>
                    <el-popconfirm title="Are you sure to delete this?">
                        <template #reference>
                            <el-button size="mini" type="danger" @click="handleDelete(scope.$index,scope.row)">删除el-button>
                        template>
                    el-popconfirm>

                template>

问题:

HandleEdit 传参错误
handleEdit(row){
this.form = JSON.parse(JSON.stringify( row));
this.form.id = this.form.id;
this.dialogVisible = true
},

这里需要把handleDelete(scope.$index,scope.row)改为handleDelete(scope.row)即可

export default {
  name: "Login",
  data() {
    return {
      form:{}
    }
  }
}

form()一定要定义在return()方法中

你可能感兴趣的:(javascript,开发语言,ecmascript)