Skip to content

Commit

Permalink
feat: button 类型导出优化
Browse files Browse the repository at this point in the history
  • Loading branch information
ZRMYDYCG committed Feb 11, 2025
1 parent 55fa595 commit 49495f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/components/Button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const handleBtnClickThrottle = throttle(handleBtnClick, props.throttleDuration,
})
defineExpose<ButtonInstance>({
ref: _ref
ref: _ref,
disabled,
size,
type
})
</script>

Expand Down
5 changes: 4 additions & 1 deletion packages/components/Button/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {Component, Ref} from "vue";
import type {Component, ComputedRef, Ref} from "vue";

export type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info'
export type NativeButtonType = 'button' |'submit' |'reset'
Expand Down Expand Up @@ -39,5 +39,8 @@ export interface ButtonEmits {

export interface ButtonInstance {
ref: Ref<HTMLButtonElement | void>
disabled: ComputedRef<boolean>
size: ComputedRef<ButtonSize | "">
type: ComputedRef<ButtonType | "">
}

0 comments on commit 49495f4

Please sign in to comment.