tabs.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {localeOptions, localeProps} from '../../utils';
  2. const label = '标签页';
  3. const name = 'elTabs';
  4. export default {
  5. menu: 'layout',
  6. icon: 'icon-tab',
  7. label,
  8. name,
  9. mask: false,
  10. event: ['tabClick', 'tabChange', 'tabRemove', 'tabAdd', 'edit'],
  11. children: 'elTabPane',
  12. rule() {
  13. return {
  14. type: name,
  15. style: {width: '100%'},
  16. children: []
  17. };
  18. },
  19. props(_, {t}) {
  20. return localeProps(t, name + '.props', [{
  21. type: 'select',
  22. field: 'type',
  23. options: [{
  24. label: 'card',
  25. value: 'card'
  26. }, {label: 'border-card', value: 'border-card'}]
  27. }, {type: 'switch', field: 'closable'}, {
  28. type: 'select',
  29. field: 'tabPosition',
  30. options: localeOptions(t, [{label: 'top', value: 'top'}, {label: 'right', value: 'right'}, {
  31. label: 'left',
  32. value: 'left'
  33. }])
  34. }, {type: 'switch', field: 'stretch'}]);
  35. }
  36. };