使用彈框打開新頁面時:
第一種打開彈框方式:
父頁面:
this.createHanlder(‘這是標題’,{id:this.id,name:this.name})
前面傳入的時標題參數,後邊傳入的是其他參數,可以根據自己所需參數進行傳參。
彈框接收時:
打印出 this.parentParam 即可
{{this.parentParam}}
第二種打開彈框方式:
父頁面:
this.$getRef(‘此處是彈框組件自定義的ref’).show({id:this.id,name:this.name})
例如:
在這裏插入代碼片
<edit ref='mydolag'></edit>
<el-button @click='getdolag'></el-button>
<script>
methods:{
getdolag(){
this.$getRef('mydolag').show({id:this.id,name:this.name})
}
}
</script>