1.在body里面添加按钮
<a
title="字典项"
href="javascript:;"
v-funcode="'acl_sDict/dirSDict'"
@click="openNodeAndClick(data)"
> 字典项</a
>
2.在子页面methods里面为按钮添加方法:$emit将数据传到父页面
methods: {
openNodeAndClick(data) {
this.$emit('openNodeAndClick',data);
},
}
3.在父页面写一个方法绑定子页面方法@openNodeAndClick
<component ref="DirSDict" :is="'DirSDict'" :params="params" @openNodeAndClick="openNodeAndClick"></component>
4.在父页面methods里面写方法
methods: {
openNodeAndClick(data){
this.params.parentid = data.uuid
this.$refs.DirSDict.data.parentid = data.uuid;
// initialIndex
this.$refs.DirSDict.reset();
},
},