获取到的后台数据
已有使用elementui的select选择器的实现代码
.vue文件
html部分代码
js部分代码
// 数据获取
getCategory(data).then(res => {
const result = res.data.filter(e => {
if (this.language === 'zh') {
return e.name === '帮助中心'
} else {
return e.name === 'Help'
}
})
this.categoryList = result[0].child
})
},
handleCategory(value) {
this.assistantCategory = null
this.assistantList = []
if (value) {
this.assistantList = this.categoryList.filter((e, i) => {
return e.id === value
})
this.assistantList = this.assistantList[0].child
}
}
}
已有显示效果
需要换成使用级联选择器