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 @@