vue 子组件 调用 父页面 或者 组件 进行传值渲染

vue 子组件 调用 父页面 或者 组件 进行传值渲染,第1张

vue 子组件 调用 父页面 或者 组件 进行传值渲染

//子组件 props方式
 Vue.component('app-manageattr', {
        template: '#app-manageattr',
        props: {
            enter: {
                type: Function,
                default: null
            }
       },
  }
  methods: {
	  getDetail() {
	      if (this.enter) {
	          this.enter(detail) //
	      }
	  }
  }
  //父页面、组件
  <app-manageattr :enter="searchEnter"></app-manageattr>
  methods: {
     searchEnter: function(data) {
         this.form = data
     },
  }

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/940933.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-17
下一篇2022-05-17

发表评论

登录后才能评论

评论列表(0条)

    保存