diff --git a/src/views/data/Framework.vue b/src/views/data/Framework.vue index 78a9405..ed95737 100644 --- a/src/views/data/Framework.vue +++ b/src/views/data/Framework.vue @@ -128,9 +128,7 @@ diff --git a/src/views/data/Introduce.vue b/src/views/data/Introduce.vue index 62d98ee..b10f048 100644 --- a/src/views/data/Introduce.vue +++ b/src/views/data/Introduce.vue @@ -84,7 +84,9 @@ export default { }, methods: { getData(){ + // 获取分类 this.$post(this.api.getTableByClassification).then(res => { + // 递归处理id和label function handleId(data){ data.map(n => { n.id = String(n.id) @@ -98,15 +100,16 @@ export default { this.typeList = res // 取首个的id和简介 - this.dataSource = res[0].dataSource if(res[0].children.length){ let item = res[0].children[0] this.categoryId = item.id + this.dataSource = res[0].children[0].dataSource this.defaultActive = [item.id] this.introduceText = item.introduce this.introduce = item.introduce }else{ this.categoryId = res[0].id + this.dataSource = res[0].dataSource this.defaultActive = [res[0].id] this.introduceText = res[0].introduce this.introduce = res[0].introduce