打印/下载
Vue案例

引入

import VuePicker from 'vue-pickers'
Vue.use(VuePicker, {name: 'vue-picker'});

Html

<button @click="demoCilck">二级联动</button>
<vue-picker :data="pickData" :layer="2" :showToolbar="true" :visible.sync="pickerShow"></vue-picker>

JavaScript

export default {
  data(){
    return {
      pickerShow: false,
      pickData: [],
    }
  },
  methods:{

    /* 二级联动 */
    demoCilck(){
      this.pickerShow = true;
      this.pickData = [
        {label: '深圳',value: 'sz',
          children: [{label: '南山',value: 'ns',},{label: '福田',value: 'ft',},]
        },
        {label: '广州',value: 'gz',
          children: [{label: '越秀',value: 'yx',},{label: '荔湾',value: 'lw',},]
        },
        {label: '上海',value: 'sh',
          children: [{label: '黄浦',value: 'hp',},]
        },
        {label: '北京',value: 'bj',
          children: [{label: '东城',value: 'dc',},{label: '西城',value: 'xc',},]
        }
      ];
    },

  },
}

参数

https://github.com/naihe138/vue-picker

{{copy}}