refactor(Button): setup props add type (#1879)

* refactor(Button): setup props add type

* refactor(Button): IButtonProps type
This commit is contained in:
Enoch Qin 2021-04-21 15:13:40 +08:00 committed by GitHub
parent dc7e64e0e0
commit 2cef7566c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,8 +36,8 @@ type IButtonType = PropType<'primary' | 'success' | 'warning' | 'danger' | 'info
type IButtonNativeType = PropType<'button' | 'submit' | 'reset'>
interface IButtonProps {
type: string
size: string
type: IButtonType
size: PropType<ComponentSize>
icon: string
nativeType: string
loading: boolean
@ -94,7 +94,7 @@ export default defineComponent({
emits: ['click'],
setup(props, ctx) {
setup(props: IButtonProps, { emit }) {
const $ELEMENT = useGlobalConfig()
const elForm = inject(elFormKey, {} as ElFormContext)
@ -109,7 +109,7 @@ export default defineComponent({
//methods
const handleClick = evt => {
ctx.emit('click', evt)
emit('click', evt)
}
return {