From 041012b3ee04d960c1e38895839225613f7af377 Mon Sep 17 00:00:00 2001
From: Yanbowen <349952469@qq.com>
Date: Sat, 18 Dec 2021 16:50:20 +0800
Subject: [PATCH] =?UTF-8?q?feat(projects):=20=E5=9B=BE=E6=A0=87=E9=80=89?=
=?UTF-8?q?=E6=8B=A9=E5=99=A8=E5=A2=9E=E5=8A=A0=E6=89=A9=E5=B1=95=E6=A0=91?=
=?UTF-8?q?=E5=BD=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/common/IconSelect/index.vue | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/components/common/IconSelect/index.vue b/src/components/common/IconSelect/index.vue
index a79ce678c..42f334357 100644
--- a/src/components/common/IconSelect/index.vue
+++ b/src/components/common/IconSelect/index.vue
@@ -3,7 +3,7 @@
-
+
@@ -31,10 +31,12 @@ import { Icon } from '@iconify/vue';
import { useThemeStore } from '@/store';
interface Props {
- /** 绑定的图标 */
+ /** 选中的图标 */
value: string;
/** 图标列表 */
- icons?: string[];
+ icons: string[];
+ /** 未选中图标 */
+ emptyIcon?: string;
}
interface Emits {
@@ -42,14 +44,14 @@ interface Emits {
}
const props = withDefaults(defineProps(), {
- icons: () => []
+ emptyIcon: 'mdi:apps'
});
const emit = defineEmits();
const theme = useThemeStore();
const searchValue = ref('');
-
+const iconsList = computed(() => props.icons.filter(v => v.includes(searchValue.value)));
const modelValue = computed({
get() {
return props.value;
@@ -59,8 +61,6 @@ const modelValue = computed({
}
});
-const iconsList = computed(() => props.icons.filter(v => v.includes(searchValue.value)));
-
function handleChange(iconItem: string) {
modelValue.value = iconItem;
}