vue 子组件传递参数给父组件 的实例

父组件:

<template>


    <Survey-form v-on:tranApi = "updataApi"></Survey-form>
             <!-- 通过 tranApi 接受参数。。。-->           
</template>

<script>

methods:{
  updataApi:function(title,id,re_id,class_id,show1,a){
  //title,id,re_id,class_id,show1,a 为子组件传来的参数

this.title = title this.id = id this.user_temp_id = re_id this.class_id = class_id this.show1 = show1 this.a = a }, </script>

子组件

<script>
vm.$emit("tranApi",vm.Title,vm.su_id,vm.re_id,vm.class_id,vm.show1,vm.a)

//通过 TranApi 传递参数 vm.Title,vm.su_id,vm.re_id,vm.class_id,vm.show1,vm.a
</script>

 

posted on 2018-05-15 23:13  筱箃  阅读(254)  评论(0编辑  收藏  举报

导航