(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

@ -166,19 +166,22 @@ onMounted(() => {
});
const getMarginLeft = computed(() => {
if (props.mode == "block") {
if(props.labelPosition != "top") {
let labelWidth = typeof props.labelWidth === "string" ? parseFloat(props.labelWidth) : props.labelWidth;
labelWidth += 15;
return {
"margin-left": `${labelWidth}px`,
};
} else {
return {
"margin-left": "0px",
}
}
if (props.mode == "block") {
if (props.labelPosition != "top") {
let labelWidth =
typeof props.labelWidth === "string"
? parseFloat(props.labelWidth)
: props.labelWidth;
labelWidth += 15;
return {
"margin-left": `${labelWidth}px`,
};
} else {
return {
"margin-left": "0px",
};
}
}
});
</script>

View File

@ -68,7 +68,11 @@ const open = function () {
const emit = defineEmits(["update:modelValue", "change", "search", "create"]);
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,
multiple: props.multiple,
} as SelectItem);