From adb72bf10de23165ed92ca6ff65dcd15f8697708 Mon Sep 17 00:00:00 2001 From: Jo <479214531@qq.com> Date: Sat, 13 Nov 2021 02:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BA=A7=E5=93=81=E8=A1=A8?= =?UTF-8?q?=E5=A4=B4=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/data/Framework.vue | 4 +--- src/views/data/Introduce.vue | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) 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