index.js 927 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
  2. // Utils
  3. import { createNamespace } from '../utils';
  4. import { inherit } from '../utils/functional'; // Types
  5. var _createNamespace = createNamespace('divider'),
  6. createComponent = _createNamespace[0],
  7. bem = _createNamespace[1];
  8. function Divider(h, props, slots, ctx) {
  9. var _bem;
  10. return h("div", _mergeJSXProps([{
  11. "attrs": {
  12. "role": "separator"
  13. },
  14. "style": {
  15. borderColor: props.borderColor
  16. },
  17. "class": bem((_bem = {
  18. dashed: props.dashed,
  19. hairline: props.hairline
  20. }, _bem["content-" + props.contentPosition] = slots.default, _bem))
  21. }, inherit(ctx, true)]), [slots.default && slots.default()]);
  22. }
  23. Divider.props = {
  24. dashed: Boolean,
  25. hairline: {
  26. type: Boolean,
  27. default: true
  28. },
  29. contentPosition: {
  30. type: String,
  31. default: 'center'
  32. }
  33. };
  34. export default createComponent(Divider);