Skip to content

Commit

Permalink
fix: 修复部分类型问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed May 8, 2023
1 parent 64bebac commit 6081626
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md)

## 0.36.0 (2023-05-08)

**优化**

- 优化 `f-trigger``f-dropdown` 样式细节
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/_hooks/use-global/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface UseGlobalReturn {
* @param { Object } prop 组件的 prop
* @returns { Object } 根据优先级返回需要的参数
*/
export const useGlobal = (prop?: UseGlobalProp): UseGlobalReturn => {
export const useGlobal = (prop?: Partial<UseGlobalProp>): UseGlobalReturn => {
/** 获取全局配置组件注入的依赖项 */
const global: FightingGlobalProps | null = inject(FIGHTING_GLOBAL_PROPS_KEY, null)

Expand Down
14 changes: 7 additions & 7 deletions packages/fighting-design/time-picker/src/time-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*
* @param { boolean | 'now' } [target = true] 点击的是否为确定
*/
const onConfirm = (target: boolean | 'now' = true): void => {
const onConfirm = (evt: MouseEvent, target: boolean | 'now' = true): void => {
/**
* 如果为真说明点击的是确定按钮
*
Expand Down Expand Up @@ -74,7 +74,7 @@
* 如果非布尔值类型,咋代表点击的是当前时间,则不需要关闭
*/
if (isBoolean(target)) {
;(triggerInstance.value as TriggerInstance).handelClose()
(triggerInstance.value as TriggerInstance).handelClose(evt)
}
}
Expand Down Expand Up @@ -220,11 +220,11 @@

<!-- 操作栏 -->
<div class="f-time-picker__option">
<f-button size="mini" :on-click="() => onConfirm('now')">当前</f-button>
<f-button size="mini" :on-click="() => onConfirm(false)">取消</f-button>
<f-button type="primary" size="mini" :on-click="() => onConfirm(true)"
>确定</f-button
>
<f-button size="mini" :on-click="evt => onConfirm(evt, 'now')">当前</f-button>
<f-button size="mini" :on-click="evt => onConfirm(evt, false)">取消</f-button>
<f-button type="primary" size="mini" :on-click="evt => onConfirm(evt, true)">
确定
</f-button>
</div>
</template>
</f-trigger>
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/trigger/src/trigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
})
/** 向外导出关闭方法 */
defineExpose({ visible })
defineExpose({ handelClose })
</script>

<template>
Expand Down

0 comments on commit 6081626

Please sign in to comment.