From 0e736c889f9cd3ca51c54becf81b6433549c4b78 Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail> Date: 星期五, 05 五月 2023 10:23:41 +0800 Subject: [PATCH] 优化已选择下拉图标高亮回显 --- src/components/SvgIcon/index.vue | 34 ++++++++++++++-------------------- 1 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue index 8c101f6..f3562d7 100644 --- a/src/components/SvgIcon/index.vue +++ b/src/components/SvgIcon/index.vue @@ -4,33 +4,27 @@ </svg> </template> -<script> -export default defineComponent({ - props: { +<script setup lang="ts"> +const props = defineProps({ iconClass: { - type: String, - required: true + type: String, + required: true }, className: { - type: String, - default: '' + type: String, + default: '' }, color: { - type: String, - default: '' + type: String, + default: '' }, - }, - setup(props) { - return { - iconName: computed(() => `#icon-${props.iconClass}`), - svgClass: computed(() => { - if (props.className) { - return `svg-icon ${props.className}` - } - return 'svg-icon' - }) +}) +const iconName = computed(() => `#icon-${props.iconClass}`); +const svgClass = computed(() => { + if (props.className) { + return `svg-icon ${props.className}` } - } + return 'svg-icon' }) </script> -- Gitblit v1.9.3