|
|
@ -84,7 +84,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData(){ |
|
|
|
getData(){ |
|
|
|
|
|
|
|
// 获取分类 |
|
|
|
this.$post(this.api.getTableByClassification).then(res => { |
|
|
|
this.$post(this.api.getTableByClassification).then(res => { |
|
|
|
|
|
|
|
// 递归处理id和label |
|
|
|
function handleId(data){ |
|
|
|
function handleId(data){ |
|
|
|
data.map(n => { |
|
|
|
data.map(n => { |
|
|
|
n.id = String(n.id) |
|
|
|
n.id = String(n.id) |
|
|
@ -98,15 +100,16 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
this.typeList = res |
|
|
|
this.typeList = res |
|
|
|
// 取首个的id和简介 |
|
|
|
// 取首个的id和简介 |
|
|
|
this.dataSource = res[0].dataSource |
|
|
|
|
|
|
|
if(res[0].children.length){ |
|
|
|
if(res[0].children.length){ |
|
|
|
let item = res[0].children[0] |
|
|
|
let item = res[0].children[0] |
|
|
|
this.categoryId = item.id |
|
|
|
this.categoryId = item.id |
|
|
|
|
|
|
|
this.dataSource = res[0].children[0].dataSource |
|
|
|
this.defaultActive = [item.id] |
|
|
|
this.defaultActive = [item.id] |
|
|
|
this.introduceText = item.introduce |
|
|
|
this.introduceText = item.introduce |
|
|
|
this.introduce = item.introduce |
|
|
|
this.introduce = item.introduce |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.categoryId = res[0].id |
|
|
|
this.categoryId = res[0].id |
|
|
|
|
|
|
|
this.dataSource = res[0].dataSource |
|
|
|
this.defaultActive = [res[0].id] |
|
|
|
this.defaultActive = [res[0].id] |
|
|
|
this.introduceText = res[0].introduce |
|
|
|
this.introduceText = res[0].introduce |
|
|
|
this.introduce = res[0].introduce |
|
|
|
this.introduce = res[0].introduce |
|
|
|