mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-12 10:45:10 +08:00
e1add47603
* feat(hooks): add useAttrs hook * feat(hooks): undo binding class and style automatically * test: remove unused import statement
40 lines
843 B
Vue
40 lines
843 B
Vue
<template>
|
|
<div :class="['el-divider', `el-divider--${direction}`]">
|
|
<div
|
|
v-if="$slots.default && direction !== 'vertical'"
|
|
:class="['el-divider__text', `is-${contentPosition}`]"
|
|
>
|
|
<slot></slot>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue'
|
|
|
|
interface IDividerProps {
|
|
direction: string
|
|
contentPosition: string
|
|
}
|
|
|
|
export default defineComponent({
|
|
name: 'ElDivider',
|
|
props: {
|
|
direction: {
|
|
type: String,
|
|
default: 'horizontal',
|
|
validator(val: string): boolean {
|
|
return ['horizontal', 'vertical'].indexOf(val) !== -1
|
|
},
|
|
},
|
|
contentPosition: {
|
|
type: String,
|
|
default: 'center',
|
|
validator(val: string): boolean {
|
|
return ['left', 'center', 'right'].indexOf(val) !== -1
|
|
},
|
|
},
|
|
},
|
|
})
|
|
</script>
|