Merge branch 'master' of https://gitee.com/youlaiorg/vue3-element-admin
This commit is contained in:
@@ -123,7 +123,7 @@ watch(
|
|||||||
const matchedOption = newOptions.find(
|
const matchedOption = newOptions.find(
|
||||||
(option) => option.value === selectedValue.value
|
(option) => option.value === selectedValue.value
|
||||||
);
|
);
|
||||||
if (!matchedOption) {
|
if (!matchedOption && props.type !== "checkbox") {
|
||||||
selectedValue.value = ""; // 如果找不到匹配项,清空选中
|
selectedValue.value = ""; // 如果找不到匹配项,清空选中
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,12 +111,15 @@ const elementIcons = ref<string[]>(Object.keys(ElementPlusIconsVue));
|
|||||||
const selectedIcon = defineModel("modelValue", {
|
const selectedIcon = defineModel("modelValue", {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
default: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const filterText = ref("");
|
const filterText = ref("");
|
||||||
const filteredSvgIcons = ref<string[]>([]);
|
const filteredSvgIcons = ref<string[]>([]);
|
||||||
const filteredElementIcons = ref<string[]>(elementIcons.value);
|
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() {
|
function loadIcons() {
|
||||||
const icons = import.meta.glob("../../assets/icons/*.svg");
|
const icons = import.meta.glob("../../assets/icons/*.svg");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const stringValue = ref("1"); // 性别(值为String)
|
const stringValue = ref("1"); // 性别(值为String)
|
||||||
const numberValue = ref(1); // 性别(值为Number)
|
const numberValue = ref(1); // 性别(值为Number)
|
||||||
const arraryValue = ref(["1", "2"]); // 性别(值为Array)
|
const arrayValue = ref(["1", "2"]); // 性别(值为Array)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -38,7 +38,7 @@ const arraryValue = ref(["1", "2"]); // 性别(值为Array)
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="复选框字典">
|
<el-form-item label="复选框字典">
|
||||||
<dict v-model="arraryValue" type="checkbox" code="gender" />
|
<dict v-model="arrayValue" type="checkbox" code="gender" />
|
||||||
<el-link :underline="false" type="success" class="ml-5">
|
<el-link :underline="false" type="success" class="ml-5">
|
||||||
值为Number: const value = ref(["1", "2"]);
|
值为Number: const value = ref(["1", "2"]);
|
||||||
</el-link>
|
</el-link>
|
||||||
|
|||||||
Reference in New Issue
Block a user