1、在孙组件里定义事件,通过$emit把值传出去
孙组件:planPop.vue
<template slot="action" slot-scope="record">
<span @click="handleDetail(record)" class="detailBtn">查看</span>
</template>
// 点击查看
handleDetail(record) {
this.$emit('showPlanImg', true);
this.$emit('getPlanId', record.id);
},
子组件:siteSearch.vue
<plan-pop ref="plan" :manufactorList="manufactorList" :siteTypeList="siteTypeList" :deviceTypeList="deviceTypeList" @moveToSitePlan="moveToSitePlan" v-on="$listeners"></plan-pop>
3、父组件通过传过来的自定义事件,获取孙组件的值
父组件:index.vue
<site-search ref="siteSearch" :showLeft="showLeft" :regionList="regionList" :s