zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    攀岩
    插入排序
    runtime error
    vector
    旅行家
    九键字母组合
    [蓝桥杯][基础训练]Sine之舞
    代码计算程序运行的时间
    max_element
    distance
  • 原文地址:https://www.cnblogs.com/wag-tail-118/p/9043663.html
Copyright © 2011-2022 走看看