-
Notifications
You must be signed in to change notification settings - Fork 314
Closed
Labels
refactoringRefactoring (重构)Refactoring (重构)
Description
What problem does this feature solve
Adding type declaration to components can improve the developer experience(DX).
建议优先完善高频组件的 TypeScript 类型声明。
What does the proposed API look like
Take the alert component as an example.
packages/renderless/src/alert/vue.ts
// Add type declaration to state
const state: IAlertState = reactive({
show: true,
getIcon: computed(() => api.computedGetIcon()),
getTitle: computed(() => api.computedGetTitle()),
contentVisible: false,
contentDescribeHeight: 0,
contentDefaultHeight: 0,
contentMaxHeight: constants.CONTENT_MAXHEUGHT,
scrollStatus: false
})
export interface IAlertState {
show: boolean
getIcon: ComputedRef<string>
getTitle: ComputedRef<string>
contentVisible: boolean
contentDescribeHeight: number
contentDefaultHeight: number
contentMaxHeight: number
scrollStatus: boolean
}

Metadata
Metadata
Assignees
Labels
refactoringRefactoring (重构)Refactoring (重构)