index.js 842 B

123456789101112131415161718192021222324252627282930
  1. import { ElButton } from 'element-plus'
  2. import './index.less'
  3. export default {
  4. name: 'CipTableButton',
  5. props: {
  6. type: {
  7. type: String,
  8. default: 'primary'
  9. },
  10. size: {
  11. type: String,
  12. default: 'mini'
  13. },
  14. icon: {},
  15. disabled: Boolean
  16. },
  17. setup (props, { attrs, slots }) {
  18. return () => <ElButton {...attrs} class={'cip-table-button'} disabled={props.disabled} type={'text'} size={props.size} icon={props.icon}>
  19. <span class={[{ [`cip-${props.type}-color`]: !props.disabled }, 'hover']}>{slots.default?.()}</span>
  20. </ElButton>
  21. // return () => h(ElButton, {
  22. // ...attrs,
  23. // type: 'text',
  24. // size: props.size,
  25. // icon: props.icon
  26. // }, {
  27. // default: () => <span class={[`cip-${props.type}-color`, 'hover']}>{slots.default?.()}</span>
  28. // })
  29. }
  30. }