From 2d973d5fc7bca92644b6ab43ee805851cbdef572 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Mon, 21 Oct 2024 18:39:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-module/model-lines/index.vue | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/common/custom-module/model-lines/index.vue b/src/components/common/custom-module/model-lines/index.vue index 07c99df1..4397ccb0 100644 --- a/src/components/common/custom-module/model-lines/index.vue +++ b/src/components/common/custom-module/model-lines/index.vue @@ -8,37 +8,32 @@ const props = defineProps({ default: () => { return {}; }, - required: true + required: true, }, isPercentage: { type: Boolean, - default: false + default: false, }, scale: { type: Number, - default: 1 - } + default: 1, + }, }); // 用于页面判断显示 const form = reactive(props.value); const border_style = computed(() => { if (form.line_settings === 'horizontal') { - return `${ set_count() } margin: 5px 0;border-bottom: ${form.line_size * props.scale }px ${form.line_style} ${form.line_color};`; + return `${set_count()} margin: 5px 0;border-bottom: ${form.line_size * props.scale}px ${form.line_style} ${form.line_color};`; } else { - return `${ set_count() } margin: 0 5px;border-right: ${form.line_size * props.scale }px ${form.line_style} ${form.line_color};`; + return `${set_count()} margin: 0 5px;border-right: ${form.line_size * props.scale}px ${form.line_style} ${form.line_color};`; } }); const set_count = () => { - if (props.isPercentage) { - return ''; + if (form.line_settings === 'horizontal') { + return `width: ${form.com_width}px;`; } else { - if (form.line_settings === 'horizontal') { - return `width: ${ form.com_width }px;`; - } else { - return `height: ${ form.com_height }px;`; - } - + return `height: ${form.com_height}px;`; } };