element Cascader 级联选择器,如何使children为空时,不显示
来源:5-3 Nuxt.js基础(3)

Bearxsh
2019-04-22
返回json数据:
{
"code": 200,
"options": [
{
"value": 1,
"label": "水果",
"children": [
{
"value": 5,
"label": "甜瓜",
"children": [
{
"value": 14,
"label": "绿宝甜瓜",
"children": []
},
{
"value": 15,
"label": "黄金甜瓜",
"children": []
}
]
},
{
"value": 6,
"label": "西瓜",
"children": [
{
"value": 16,
"label": "黑美人西瓜",
"children": []
},
{
"value": 17,
"label": "甜王西瓜",
"children": []
}
]
},
{
"value": 7,
"label": "油桃",
"children": []
}
]
},
{
"value": 3,
"label": "蔬菜",
"children": [
{
"value": 8,
"label": "黄瓜",
"children": [
{
"value": 18,
"label": "密刺黄瓜",
"children": []
},
{
"value": 19,
"label": "旱黄瓜",
"children": []
}
]
},
{
"value": 9,
"label": "土豆",
"children": []
},
{
"value": 10,
"label": "西红柿",
"children": []
}
]
},
{
"value": 4,
"label": "水产",
"children": [
{
"value": 11,
"label": "小龙虾",
"children": []
},
{
"value": 12,
"label": "螃蟹",
"children": [
{
"value": 20,
"label": "花蟹",
"children": []
},
{
"value": 21,
"label": "关公蟹",
"children": []
},
{
"value": 22,
"label": "孟加拉蟹",
"children": []
}
]
},
{
"value": 13,
"label": "生蚝",
"children": []
}
]
}
],
"message": "成功"
}
写回答
1回答
-
快乐动起来呀
2019-04-22
你想问element ui的组件怎么使用吗?官方文档有给定具体的数据合适,你用自己收到的json数据处理成它所需要的格式不就可以了吗
012019-04-23
相似问题