mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
feat: Divider component
This commit is contained in:
33
src-next/divider/index.js
Normal file
33
src-next/divider/index.js
Normal 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>
|
||||
);
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user