element Cascader 级联选择器动态加载实例

封装Cascader 级联选择器动态加载组件实现省市区三级联动

组件代码片段



引用组件

后台接口:

findProvince返回数据格式

{
	"code":"0",
	"data":[
		{
			"id":"110000",
			"levelType":1,
			"mergeName":"中国,北京",
			"name":"北京",
			"parentId":"100000"
		},
		{
			"id":"120000",
			"levelType":1,
			"mergeName":"中国,天津",
			"name":"天津",
			"parentId":"100000"
		},
		{
			"id":"130000",
			"levelType":1,
			"mergeName":"中国,河北省",
			"name":"河北省",
			"parentId":"100000"
		}
	],
	"msg":"success",
	"serverTime":"2020-05-15 11:38:53"
}

findChildById/110000 返回数据格式:

{
	"code":"0",
	"data":[
		{
			"id":"110100",
			"levelType":2,
			"mergeName":"中国,北京,北京市",
			"name":"北京市",
			"parentId":"110000"
		}
	],
	"msg":"success",
	"serverTime":"2020-05-15 11:38:55"
}

效果图

element Cascader 级联选择器动态加载实例_第1张图片

你可能感兴趣的:(Vue)