先将需要的值在点击事件中传进来

<el-button type="primary" size="small" @click="handleUpdate(itemSon.userId)">修改照片</el-button>

在data中定义空值

	id: null;

在方法中接收所传参数

        handleUpdate(e) {
            this.reset();
            this.open = true;
            this.id = e;//将e保存到id内
        }

在其他方法中直接调用this.id就可以拿到了。
简而言之就是将数据保存到data内。

Logo

前往低代码交流专区

更多推荐