fix: 🐛 修复图标选取组件和字典复选组件的使用bug
修复图标选取组件和字典复选组件的使用bug
This commit is contained in:
@@ -123,7 +123,7 @@ watch(
|
||||
const matchedOption = newOptions.find(
|
||||
(option) => option.value === selectedValue.value
|
||||
);
|
||||
if (!matchedOption) {
|
||||
if (!matchedOption && props.type !== "checkbox") {
|
||||
selectedValue.value = ""; // 如果找不到匹配项,清空选中
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,12 +111,15 @@ const elementIcons = ref<string[]>(Object.keys(ElementPlusIconsVue));
|
||||
const selectedIcon = defineModel("modelValue", {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
});
|
||||
|
||||
const filterText = ref("");
|
||||
const filteredSvgIcons = ref<string[]>([]);
|
||||
const filteredElementIcons = ref<string[]>(elementIcons.value);
|
||||
const isElementIcon = computed(() => selectedIcon.value.startsWith("el-icon-"));
|
||||
const isElementIcon = computed(() => {
|
||||
return selectedIcon.value && selectedIcon.value.startsWith("el-icon");
|
||||
});
|
||||
|
||||
function loadIcons() {
|
||||
const icons = import.meta.glob("../../assets/icons/*.svg");
|
||||
|
||||
Reference in New Issue
Block a user