6 changed files with 28 additions and 24 deletions
@ -1,6 +1,9 @@ |
|||
import { withInstall } from '/@/utils'; |
|||
import type { ExtractPropTypes } from 'vue'; |
|||
import button from './src/BasicButton.vue'; |
|||
import popConfirmButton from './src/PopConfirmButton.vue'; |
|||
import { buttonProps } from './src/props'; |
|||
|
|||
export const Button = withInstall(button); |
|||
export const PopConfirmButton = withInstall(popConfirmButton); |
|||
export declare type ButtonProps = Partial<ExtractPropTypes<typeof buttonProps>>; |
|||
|
|||
@ -0,0 +1,19 @@ |
|||
export const buttonProps = { |
|||
color: { type: String, validator: (v) => ['error', 'warning', 'success', ''].includes(v) }, |
|||
loading: { type: Boolean }, |
|||
disabled: { type: Boolean }, |
|||
/** |
|||
* Text before icon. |
|||
*/ |
|||
preIcon: { type: String }, |
|||
/** |
|||
* Text after icon. |
|||
*/ |
|||
postIcon: { type: String }, |
|||
/** |
|||
* preIcon and postIcon icon size. |
|||
* @default: 14 |
|||
*/ |
|||
iconSize: { type: Number, default: 14 }, |
|||
onClick: { type: Function as PropType<(...args) => any>, default: null }, |
|||
}; |
|||
Loading…
Reference in new issue