(component): update

This commit is contained in:
就眠儀式 2022-07-24 22:44:47 +08:00
parent 406fb7e828
commit 1a7aacbcb8
2 changed files with 20 additions and 13 deletions

View File

@ -168,7 +168,10 @@ onMounted(() => {
const getMarginLeft = computed(() => { const getMarginLeft = computed(() => {
if (props.mode == "block") { if (props.mode == "block") {
if (props.labelPosition != "top") { if (props.labelPosition != "top") {
let labelWidth = typeof props.labelWidth === "string" ? parseFloat(props.labelWidth) : props.labelWidth; let labelWidth =
typeof props.labelWidth === "string"
? parseFloat(props.labelWidth)
: props.labelWidth;
labelWidth += 15; labelWidth += 15;
return { return {
"margin-left": `${labelWidth}px`, "margin-left": `${labelWidth}px`,
@ -176,7 +179,7 @@ const getMarginLeft = computed(() => {
} else { } else {
return { return {
"margin-left": "0px", "margin-left": "0px",
} };
} }
} }
}); });

View File

@ -68,7 +68,11 @@ const open = function () {
const emit = defineEmits(["update:modelValue", "change", "search", "create"]); const emit = defineEmits(["update:modelValue", "change", "search", "create"]);
const selectItem = ref<SelectItem>({ const selectItem = ref<SelectItem>({
value: !props.multiple? props.modelValue : props.modelValue ? ([] as any[]).concat(props.modelValue) : [], value: !props.multiple
? props.modelValue
: props.modelValue
? ([] as any[]).concat(props.modelValue)
: [],
label: props.multiple ? [] : null, label: props.multiple ? [] : null,
multiple: props.multiple, multiple: props.multiple,
} as SelectItem); } as SelectItem);