123456789101112131415161718192021222324252627282930 |
- import { ElButton } from 'element-plus'
- import './index.less'
- export default {
- name: 'CipTableButton',
- props: {
- type: {
- type: String,
- default: 'primary'
- },
- size: {
- type: String,
- default: 'mini'
- },
- icon: {},
- disabled: Boolean
- },
- setup (props, { attrs, slots }) {
- return () => <ElButton {...attrs} class={'cip-table-button'} disabled={props.disabled} type={'text'} size={props.size} icon={props.icon}>
- <span class={[{ [`cip-${props.type}-color`]: !props.disabled }, 'hover']}>{slots.default?.()}</span>
- </ElButton>
- // return () => h(ElButton, {
- // ...attrs,
- // type: 'text',
- // size: props.size,
- // icon: props.icon
- // }, {
- // default: () => <span class={[`cip-${props.type}-color`, 'hover']}>{slots.default?.()}</span>
- // })
- }
- }
|