vant二级联动picker选择器

                <van-picker :columns="columns" @change="onChange" />
    const citys = {
        '浙江': ['杭州', '宁波', '温州', '嘉兴', '湖州'],
        '福建': ['福州', '厦门', '莆田', '三明', '泉州']
    };
	data:{
	columns: [
                {
                    values: Object.keys(citys),
                    className: 'column1'
                },
                {
                    values: citys['浙江'],
                    className: 'column2',
                    defaultIndex: 2
                }
            ],
            }
            onChange(picker, values) {
                picker.setColumnValues(1, citys[values[0]]);
                console.log(values)
            },

你可能感兴趣的:(vant-ui)