路由配好了 再传个参呗

注:组件信息流转的时候只能单向
1 > 父子传参
传参:通过属性
prop:传递数据

a.父组件传参给子组件

 子组件:
    <ul>
        <li v-for="item in dataList"></li>
    </ul>

    export default {
        prop: {              //prop接收传过来的参数
            dataList: {
                type:Array,
                required:true    //校验
            }
        },
        data() {
            return {
                dataList: this.dataList
            }
        }
    }
  父组件
    <Position :data-list='List'></Position>  

b.子组件传参给父组件

父组件传一个函数给子组件
子组件:
    export default {
        prop: ['id','onbuttonInfo'],
        data() {
            return {
                posid: this.id,
                title: 'abc'
            }
        },
        mounted() {
            this.onbuttonInfo(this.title)
        }
    }
 父组件:
    <Position :id='sid' :onbuttonInfo='handleButonInfo'>职位列表</Position>
    methods:{
        handleButonInfo (msg) {
            console.log(msg)
        }
    }
    注意:浏览器的坑 会把buttonInfo 都改成全小写

2 > 动态路由传参

方式一:path:'/main/:变量名'
方式二:
方法:
    传:
    this.$router.push({name: 'goodslist',params:{"list":this.list}})
    接收:
    data() {
      return {
          goodsList: this.$route.query.list,
          val: ''
      }
    },

3 > 跳级组件传参 bus总线

1、components中建Bus.js文件
    import Vue from 'vue'
    const Bus = new Vue({

    })
    export default Bus
2、index。vue中
    import Bus from '../Bus.js'
    mounted() {
        Bus.$on('on-msg',(data)=>{   //订阅 绑定事 接收参数
            console.log(data);
        })
    }
3、positionList.vue
    import Bus from './Bus.js'
    methods:{
        do() {       //发布 传参
            this.$router.push({name:'search',})
            Bus.$emit('on-msg',120)
        }
    }    

4 > vuex传参(重点)请查看我的vuex文章 啦啦~~~~

http://www.beimohome.cn/

http://www.wu0553.com/news/20190924/28979.html
http://www.wu0553.com/news/20190924/28978.html
http://www.wu0553.com/news/20190924/28977.html
http://www.wu0553.com/news/20190924/28976.html
http://www.wu0553.com/news/20190924/28975.html
http://www.wu0553.com/news/20190924/28974.html
http://www.wu0553.com/news/20190924/28973.html
http://www.wu0553.com/news/20190924/28972.html
http://www.wu0553.com/news/20190924/28971.html
http://www.wu0553.com/news/20190924/28970.html
http://www.wu0553.com/news/20190924/28969.html
http://www.wu0553.com/news/20190924/28968.html
http://www.wu0553.com/news/20190924/28967.html
http://www.wu0553.com/news/20190924/28966.html
http://www.wu0553.com/news/20190924/28965.html
http://www.wu0553.com/news/20190924/28964.html
http://www.wu0553.com/news/20190924/28963.html
http://www.wu0553.com/news/20190924/28962.html
http://www.wu0553.com/news/20190924/28961.html
http://www.wu0553.com/news/20190924/28960.html
http://www.wu0553.com/news/20190924/28959.html
http://www.wu0553.com/news/20190924/28958.html
http://www.wu0553.com/news/20190924/28957.html
http://www.wu0553.com/news/20190924/28956.html
http://www.wu0553.com/news/20190924/28955.html
http://www.wu0553.com/news/20190924/28954.html
http://www.wu0553.com/news/20190924/28953.html
http://www.wu0553.com/news/20190924/28952.html
http://www.wu0553.com/news/20190924/28951.html
http://www.wu0553.com/news/20190924/28950.html
http://www.wu0553.com/news/20190924/28949.html
http://www.wu0553.com/news/20190924/28948.html
http://www.wu0553.com/news/20190924/28947.html
http://www.wu0553.com/news/20190924/28946.html
http://www.wu0553.com/news/20190924/28945.html
http://www.wu0553.com/news/20190924/28944.html
http://www.wu0553.com/news/20190924/28943.html
http://www.wu0553.com/news/20190924/28942.html
http://www.wu0553.com/news/20190924/28941.html
http://www.wu0553.com/news/20190924/28940.html
http://www.wu0553.com/news/20190924/28939.html
http://www.wu0553.com/news/20190924/28938.html
http://www.wu0553.com/news/20190924/28937.html
http://www.wu0553.com/news/20190924/28935.html
http://www.wu0553.com/news/20190924/28934.html
http://www.wu0553.com/news/20190924/28932.html
http://www.wu0553.com/news/20190924/28931.html
http://www.wu0553.com/news/20190924/28930.html
http://www.wu0553.com/news/20190924/28929.html
http://www.wu0553.com/news/20190924/28928.html
http://www.wu0553.com/news/20190924/28927.html
http://www.wu0553.com/news/20190924/28926.html
http://www.wu0553.com/news/20190924/28925.html
http://www.wu0553.com/news/20190924/28924.html
http://www.wu0553.com/news/20190924/28923.html
http://www.wu0553.com/news/20190924/28922.html
http://www.wu0553.com/news/20190924/28920.html
http://www.wu0553.com/news/20190924/28919.html
http://www.wu0553.com/news/20190924/28918.html
http://www.wu0553.com/news/20190924/28917.html
http://www.wu0553.com/news/20190924/28916.html
http://www.wu0553.com/news/20190924/28915.html
http://www.wu0553.com/news/20190924/28914.html
http://www.wu0553.com/news/20190924/28913.html
http://www.wu0553.com/news/20190924/28912.html
http://www.wu0553.com/news/20190924/28911.html
http://www.wu0553.com/news/20190924/28910.html
http://www.wu0553.com/news/20190924/28909.html
http://www.wu0553.com/news/20190924/28908.html
http://www.wu0553.com/news/20190924/28907.html
http://www.wu0553.com/news/20190924/28906.html
http://www.wu0553.com/news/20190924/28905.html
http://www.wu0553.com/news/20190924/28904.html
http://www.wu0553.com/news/20190924/28903.html
http://www.wu0553.com/news/20190924/28902.html
http://www.wu0553.com/news/20190924/28901.html
http://www.wu0553.com/news/20190924/28900.html
http://www.wu0553.com/news/20190924/28899.html
http://www.wu0553.com/news/20190924/28898.html
http://www.wu0553.com/news/20190924/28894.html
http://www.wu0553.com/news/20190924/28893.html
http://www.wu0553.com/news/20190924/28892.html
http://www.wu0553.com/news/20190924/28891.html
http://www.wu0553.com/news/20190924/28890.html
http://www.wu0553.com/news/20190924/28889.html
http://www.wu0553.com/news/20190924/28888.html
http://www.wu0553.com/news/28785.html
http://www.wu0553.com/news/20190924/28784.html
http://www.wu0553.com/news/28782.html
http://www.wu0553.com/news/20190924/28780.html
http://www.wu0553.com/news/28777.html
http://www.wu0553.com/news/28773.html
http://www.wu0553.com/news/28770.html
http://www.wu0553.com/news/28767.html
http://www.wu0553.com/news/28765.html
http://www.wu0553.com/news/28761.html
http://www.wu0553.com/news/28758.html
http://www.wu0553.com/news/28755.html
http://www.wu0553.com/news/28754.html
http://www.wu0553.com/news/28752.html
http://www.wu0553.com/news/28751.html
http://www.wu0553.com/news/28748.html
http://www.wu0553.com/news/20190924/28746.html
http://www.wu0553.com/news/28743.html
http://www.wu0553.com/news/20190924/28741.html
http://www.wu0553.com/news/28739.html
http://www.wu0553.com/news/28738.html
http://www.wu0553.com/news/28735.html
http://www.wu0553.com/news/28733.html
http://www.wu0553.com/news/28732.html
http://www.wu0553.com/news/28729.html
http://www.wu0553.com/news/28726.html
http://www.wu0553.com/news/28723.html
http://www.wu0553.com/news/28718.html
http://www.wu0553.com/news/28716.html
http://www.wu0553.com/news/28715.html
http://www.wu0553.com/news/20190924/28713.html
http://www.wu0553.com/news/28710.html
http://www.wu0553.com/news/20190924/28707.html
http://www.wu0553.com/news/28704.html
http://www.wu0553.com/news/28702.html
http://www.wu0553.com/news/28701.html
http://www.wu0553.com/news/28698.html
http://www.wu0553.com/news/28695.html
http://www.wu0553.com/news/28693.html
http://www.wu0553.com/news/28691.html
http://www.wu0553.com/news/28687.html
http://www.wu0553.com/news/28685.html
http://www.wu0553.com/news/28683.html
http://www.wu0553.com/news/28681.html
http://www.wu0553.com/news/28679.html
http://www.wu0553.com/news/20190924/28676.html
http://www.wu0553.com/news/28674.html
http://www.wu0553.com/news/20190924/28672.html
http://www.wu0553.com/news/28670.html
http://www.wu0553.com/news/28669.html
http://www.wu0553.com/news/28667.html
http://www.wu0553.com/news/28664.html
http://www.wu0553.com/news/28662.html
http://www.wu0553.com/news/28659.html
http://www.wu0553.com/news/28658.html
http://www.wu0553.com/news/28657.html
http://www.wu0553.com/news/28656.html
http://www.wu0553.com/news/28655.html
http://www.wu0553.com/news/28654.html
http://www.wu0553.com/news/28653.html
http://www.wu0553.com/news/20190924/28652.html
http://www.wu0553.com/news/28647.html
http://www.wu0553.com/news/20190924/28642.html
http://www.wu0553.com/news/28637.html
http://www.wu0553.com/news/28630.html
http://www.wu0553.com/news/28625.html
http://www.wu0553.com/news/28620.html
http://www.wu0553.com/news/28614.html
http://www.wu0553.com/news/28608.html
http://www.wu0553.com/news/28601.html
http://www.wu0553.com/news/28591.html
http://www.wu0553.com/news/28581.html
http://www.wu0553.com/news/28570.html
http://www.wu0553.com/news/28559.html
http://www.wu0553.com/news/28549.html
http://www.wu0553.com/news/20190924/28539.html
http://www.wu0553.com/news/28531.html
http://www.wu0553.com/news/20190924/28520.html
http://www.wu0553.com/news/28511.html
http://www.wu0553.com/news/28499.html
http://www.wu0553.com/news/28487.html
http://www.wu0553.com/news/28476.html
http://www.wu0553.com/news/28469.html
http://www.wu0553.com/news/28460.html
http://www.wu0553.com/news/28450.html
http://www.wu0553.com/news/28442.html
http://www.wu0553.com/news/28436.html
http://www.wu0553.com/news/28431.html
http://www.wu0553.com/news/28427.html
http://www.wu0553.com/news/28422.html
http://www.wu0553.com/news/20190924/28419.html
http://www.wu0553.com/news/20190924/28408.html
http://www.wu0553.com/news/28398.html
http://www.wu0553.com/news/28385.html
http://www.wu0553.com/news/28376.html
http://www.wu0553.com/news/28364.html
http://www.wu0553.com/news/28352.html
http://www.wu0553.com/news/28340.html

02-11 01:11