7006e50b8e64a760b4362ea6fa0c102672c8b61fadcb9b8b504e2f44a810f73b29980af75262e4f8d5652f8ccdc7d7c491fec0aa6923977370876bef4a0334 764 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template functional>
  2. <div
  3. v-bind="data.attrs"
  4. v-on="listeners"
  5. :class="[data.staticClass, 'el-divider', `el-divider--${props.direction}`]"
  6. >
  7. <div
  8. v-if="slots().default && props.direction !== 'vertical'"
  9. :class="['el-divider__text', `is-${props.contentPosition}`]"
  10. >
  11. <slot />
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'ElDivider',
  18. props: {
  19. direction: {
  20. type: String,
  21. default: 'horizontal',
  22. validator(val) {
  23. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  24. }
  25. },
  26. contentPosition: {
  27. type: String,
  28. default: 'center',
  29. validator(val) {
  30. return ['left', 'center', 'right'].indexOf(val) !== -1;
  31. }
  32. }
  33. }
  34. };
  35. </script>