From 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 06 十二月 2023 08:41:32 +0800
Subject: [PATCH] bug
---
minipro_standard/components/LabelSelection.vue | 35 ++++++++++++++++++-----------------
1 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/minipro_standard/components/LabelSelection.vue b/minipro_standard/components/LabelSelection.vue
index 6a26a84..0bde662 100644
--- a/minipro_standard/components/LabelSelection.vue
+++ b/minipro_standard/components/LabelSelection.vue
@@ -1,10 +1,10 @@
<template>
<scroll-view class="tag" scroll-x>
<view class="tag_list">
- <view v-for="item in TagList"
- :key="item.id"
- :class="{'tag_item': true, 'tagActive': item.id == activeId}"
- @click="change(item)">
+ <view v-for="(item, index) in TagList"
+ :key="index"
+ :class="{'tag_item': true, 'tagActive': index == activeId}"
+ @click="change(item, index)">
<text>{{item.name}}</text>
<text v-if="isShow && item.num">({{item.num}})</text>
</view>
@@ -21,27 +21,27 @@
},
data() {
return {
- activeId: ''
+ activeId: 0
};
},
methods: {
- change(item) {
- if (this.activeId !== item.id) {
- this.activeId = item.id
+ change(item, index) {
+ if (this.activeId !== index) {
+ this.activeId = index
this.$emit('change', item.id)
}
}
},
watch: {
- TagList: {
- immediate: true,
- handler(news, old) {
- let list = news
- if (list && list.length !== 0) {
- this.activeId = list[0].id
- }
- }
- }
+ // TagList: {
+ // immediate: true,
+ // handler(news, old) {
+ // let list = news
+ // if (list && list.length !== 0) {
+ // this.activeId = list[0].id
+ // }
+ // }
+ // }
}
}
</script>
@@ -80,6 +80,7 @@
text {
font-size: 26rpx;
font-weight: 400;
+ line-height: 26rpx;
color: #555555;
}
}
--
Gitblit v1.9.3