调用组件页面并传参

 //a.vue页面调用
<user-detail ref="detailRef" :detail-visible="detailVisible" @changeShow="showDetail" />
//引入
import UserDetail from './detail.vue'
  components: {UserDetail}
 
   handleDetail(id) {
      this.detailVisible = true
      this.$nextTick(() => {
        this.$refs.detailRef.dataInitialization(id)
      })
    },
detail.vue页面接收
 dataInitialization(id) {
      this.userId = id
      getEmployeeByEid({ eid: this.userId }).then(res => {
        this.form = res.data
      })
    }
原文地址:https://www.cnblogs.com/lemonmoney/p/15813860.html