后台值传给vue element Cascader 级联选择器

html


获取后台data并赋值

batch().then(res =>{
		//console.log(res.data)
		let batchdata = res.data
		//valueBatch
		let dataValueBatch = batchdata  => batchdata .map(({id, name, children}) => (children ? {
					value    : id,
					label    : name,
					children : dataValueBatch(children),
			} : {
					value : id,
					label : name,
			}));
				this.valueBatch = dataValueBatch(batchdata);
				})

你可能感兴趣的:(后台值传给vue element Cascader 级联选择器)