From ca73a173f008c8d7a9d700bad897ca24fe2d2203 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 16 十月 2023 09:29:57 +0800
Subject: [PATCH] 111
---
minipro_standard/components/LabelSelection.vue | 45 ++++++++++++++++++++++-----------------------
1 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/minipro_standard/components/LabelSelection.vue b/minipro_standard/components/LabelSelection.vue
index 6a26a84..67f65ff 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>
@@ -71,17 +71,16 @@
}
.tag_item {
min-width: 120rpx;
- padding: 14rpx 24rpx;
+ padding: 14rpx;
border-radius: 26rpx;
text-align: center;
flex-shrink: 0;
margin-right: 20rpx;
border: 1rpx solid #CCCCCC;
- text {
- font-size: 26rpx;
- font-weight: 400;
- color: #555555;
- }
+ font-size: 26rpx;
+ font-weight: 400;
+ line-height: 26rpx;
+ color: #555555;
}
}
}
--
Gitblit v1.9.3