feat: Divider component

This commit is contained in:
chenjiahan
2020-07-06 15:31:36 +08:00
parent aab12a4906
commit aa9fc7fe7c
8 changed files with 355 additions and 8 deletions

33
src-next/divider/index.js Normal file
View File

@@ -0,0 +1,33 @@
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>
);
},
});