diff --git a/src/components/course-item/course-item.vue b/src/components/course-item/course-item.vue index 8a1afc60..b37f2105 100644 --- a/src/components/course-item/course-item.vue +++ b/src/components/course-item/course-item.vue @@ -8,7 +8,7 @@ {{itemInfo.crsName}} - {{item.tagName}} + {{item.tagName}} 发布:{{itemInfo.issuTm}} @@ -26,13 +26,17 @@ }, props:{ itemInfo:{ - type:Object, + type: Object, default:()=>({ - crsName: '银行核心业务全流程实践哒哒哒哒', - tagsList:[{tagName:'公斤业务'},{tagName:'初级'}], - publicTime:"2025-01-03", - learnedNum:'2222222' + crsName: '', + tagCataList:[], + publicTime:"", + learnedNum:'' }) + }, + activeTag:{ + default: '', + type: String } }, data() { @@ -40,6 +44,21 @@ }; }, + watch:{ + activeTag:{ + handler(){}, + deep: true, + immediate: true + } + }, + computed:{ + tagsShowList(){ + if(!this.activeTag) return this.itemInfo.tagCataList + let _arr = this.itemInfo.tagCataList.filter(t=> t.tagId === this.activeTag) + let _arr1 = this.itemInfo.tagCataList.filter(t=> t.tagId !== this.activeTag) + return _arr.concat(_arr1) + } + }, methods:{ clickItem(){ this.$emit('clickItem', this.itemInfo) diff --git a/src/pages/course/index.vue b/src/pages/course/index.vue index a8019f2c..6cc5f62b 100644 --- a/src/pages/course/index.vue +++ b/src/pages/course/index.vue @@ -48,7 +48,7 @@ :type="activeTag === ''?'primary':'info'" @click="chooseTag({value:''})" > - {{item.label}} - + {{itemT.label}} - +