zoukankan      html  css  js  c++  java
  • vue2.0父向子传参,子向父传参,路由传参

    父向子传值:

    //父组件

    <selectionGroup v-for="item in tab" :item="item"></selectionGroup>

    //子组件

    <GroupItem v-for="section in item"></GroupItem>

    //子组件接收值
    props: {

    item: {
        type: Object
    },

    子向父传值:

    //子组件

    <input type="radio" @click="check(feature.description)"/>

    check(description){
    this.$emit('description',description);//第一个值是event,第二个值是 data
    },
    //父组件 
    <GroupChild @description="description"></GroupChild>
    methods: {

    description(description){

    },
     

    路由传参:

    <template>

    <list v-for="item in productList" :item="item" @details = "details(item)"></list>
    </template>
    <script>

    details (item) {

    router.push({

    name: 'details',

    params:{item:item}
      })
    }
    </script>

    //接收
    Value: this.$route.params.item,
     
     
  • 相关阅读:
    SVM的新理解
    特征提取,特征选择
    条件随机场
    分类、检测、识别
    matlab fgetl()
    matlab fopen()
    rar ubuntu
    makefile for opencv
    [洛谷P1231] 教辅的组成
    [洛谷P1514]引水入城
  • 原文地址:https://www.cnblogs.com/lonelyGentleman/p/6730849.html
Copyright © 2011-2022 走看看