element-plus/packages/divider/src/index.vue
Caaalabash 6038a23bec
feat(progress): add progress component (#71)
* feat(progress): add progress component

* fix(progress): rename type
2020-08-02 15:27:24 +08:00

43 lines
872 B
Vue

<template>
<div
v-bind="$attrs"
: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>