From 6006797280992094ff727adbc6156d29ce9dca0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Fri, 2 Dec 2022 16:27:00 +0800 Subject: [PATCH] 12/2 --- src/components/IconSelector/IconSelector.vue | 54 +++---- src/components/MultiTab/MultiTab.vue | 132 ++++++++++++------ .../detail/modules/rightContent.vue | 1 + src/views/main/BookingLedger/list/index.vue | 28 ++-- 4 files changed, 135 insertions(+), 80 deletions(-) diff --git a/src/components/IconSelector/IconSelector.vue b/src/components/IconSelector/IconSelector.vue index 810d297..07b9a27 100644 --- a/src/components/IconSelector/IconSelector.vue +++ b/src/components/IconSelector/IconSelector.vue @@ -3,7 +3,12 @@ @@ -27,7 +32,7 @@ export default { type: String } }, - data () { + data() { return { selectedIcon: this.value || '', currentTab: 'directional', @@ -35,25 +40,25 @@ export default { } }, watch: { - value (val) { + value(val) { this.selectedIcon = val this.autoSwitchTab() } }, - created () { + created() { if (this.value) { this.autoSwitchTab() } }, methods: { - handleSelectedIcon (icon) { + handleSelectedIcon(icon) { this.selectedIcon = icon this.$emit('change', icon) }, - handleTabChange (activeKey) { + handleTabChange(activeKey) { this.currentTab = activeKey }, - autoSwitchTab () { + autoSwitchTab() { icons.some(item => item.icons.some(icon => icon === this.value) && (this.currentTab = item.key)) } } @@ -61,26 +66,27 @@ export default { diff --git a/src/components/MultiTab/MultiTab.vue b/src/components/MultiTab/MultiTab.vue index bfb6e57..7fc1706 100644 --- a/src/components/MultiTab/MultiTab.vue +++ b/src/components/MultiTab/MultiTab.vue @@ -1,9 +1,9 @@