1.自定义优化
parent
d15fc355d2
commit
2d973d5fc7
|
|
@ -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;`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue