Skip to content

Commit 4ce8348

Browse files
committed
chore(Divider): clean code
1 parent 0776455 commit 4ce8348

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/runtime/components/layout/Divider.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,25 @@ export default defineComponent({
7474
setup (props) {
7575
const { ui, attrs } = useUI('divider', toRef(props, 'ui'), config)
7676
77-
const isHorizontal = computed(() => props.orientation === 'horizontal' )
78-
7977
const wrapperClass = computed(() => {
8078
return twMerge(twJoin(
8179
ui.value.wrapper.base,
82-
isHorizontal.value ? ui.value.wrapper.horizontal : ui.value.wrapper.vertical
80+
ui.value.wrapper[props.orientation]
8381
), props.class)
8482
})
8583
8684
const containerClass = computed(() => {
8785
return twJoin(
8886
ui.value.container.base,
89-
isHorizontal.value ? ui.value.container.horizontal : ui.value.container.vertical
87+
ui.value.container[props.orientation]
9088
)
9189
})
9290
9391
const borderClass = computed(() => {
9492
return twJoin(
9593
ui.value.border.base,
96-
isHorizontal.value ? ui.value.border.horizontal : ui.value.border.vertical,
97-
isHorizontal.value ? ui.value.border.size.horizontal : ui.value.border.size.vertical,
94+
ui.value.border[props.orientation],
95+
ui.value.border.size[props.orientation],
9896
ui.value.border.type[props.type]
9997
)
10098
})

0 commit comments

Comments
 (0)