其他分享
首页 > 其他分享> > 调用组件页面并传参

调用组件页面并传参

作者:互联网

 //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
      })
    }

 

标签:传参,vue,res,userId,组件,UserDetail,id,页面
来源: https://www.cnblogs.com/lemonmoney/p/15813860.html