mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-05 11:21:11 +08:00
refactor(Button): setup props add type (#1879)
* refactor(Button): setup props add type * refactor(Button): IButtonProps type
This commit is contained in:
parent
dc7e64e0e0
commit
2cef7566c1
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user