chore: 证书输出选择器优化

This commit is contained in:
xiaojunnuo
2024-09-18 14:58:59 +08:00
parent 830de90317
commit 7aa3d8e5d9
16 changed files with 25 additions and 21 deletions
@@ -14,7 +14,7 @@ export default {
default: undefined
},
from: {
type: String
type: [String, Array]
}
},
emits: ["update:modelValue"],
@@ -36,7 +36,11 @@ export default {
currentTask: currentTask.value
});
if (props.from) {
options.value = options.value.filter((item: any) => item.type === props.from);
if (typeof props.from === "string") {
options.value = options.value.filter((item: any) => item.type === props.from);
} else {
options.value = options.value.filter((item: any) => props.from.includes(item.type));
}
}
if (props.modelValue == null && options.value.length > 0) {
ctx.emit("update:modelValue", options.value[0].value);