mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
34 lines
635 B
JavaScript
34 lines
635 B
JavaScript
import { createNamespace } from '../utils';
|
|
|
|
const [createComponent, bem] = createNamespace('divider');
|
|
|
|
export default createComponent({
|
|
props: {
|
|
dashed: Boolean,
|
|
hairline: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
contentPosition: {
|
|
type: String,
|
|
default: 'center',
|
|
},
|
|
},
|
|
|
|
render() {
|
|
const Content = this.$slots.default?.();
|
|
return (
|
|
<div
|
|
role="separator"
|
|
class={bem({
|
|
dashed: this.dashed,
|
|
hairline: this.hairline,
|
|
[`content-${this.contentPosition}`]: !!Content,
|
|
})}
|
|
>
|
|
{Content}
|
|
</div>
|
|
);
|
|
},
|
|
});
|