diff --git a/packages/fighting-design/_hooks/use-count-down/index.ts b/packages/fighting-design/_hooks/use-count-down/index.ts index eaea89bc8b..9c697d3a10 100644 --- a/packages/fighting-design/_hooks/use-count-down/index.ts +++ b/packages/fighting-design/_hooks/use-count-down/index.ts @@ -18,7 +18,7 @@ export interface UseCountDownOptions { } /** - * useCountDown hook 返回值中currentTime的类型 + * useCountDown hook 返回值中 currentTime 的类型 * * @param { number } total 剩余总时间(单位毫秒) * @param { number } days 剩余天数 diff --git a/packages/fighting-design/count-down/src/count-down.vue b/packages/fighting-design/count-down/src/count-down.vue index d719bce631..a7ddfd573d 100644 --- a/packages/fighting-design/count-down/src/count-down.vue +++ b/packages/fighting-design/count-down/src/count-down.vue @@ -22,8 +22,8 @@ /** * 格式化时间格式 * - * @param format - * @param currentTime + * @param { string } format 需要格式化的时间 + * @param { Object } currentTime 时间信息 */ const formatTimeStr = (format: string, currentTime: CurrentTime): string => { const { days } = currentTime @@ -32,8 +32,8 @@ /** * 在前方补全 0 * - * @param str - * @param length + * @param { string | number } str 需要加 0 的值 + * @param { number } [length = 2] 加的长度 */ const padZero = (str: string | number, length = 2): string => { let realStr = str + '' diff --git a/packages/fighting-design/switch/__test__/switch.spec.ts b/packages/fighting-design/switch/__test__/switch.spec.ts index c9c7ff4c87..e26e6ced1c 100644 --- a/packages/fighting-design/switch/__test__/switch.spec.ts +++ b/packages/fighting-design/switch/__test__/switch.spec.ts @@ -1,7 +1,7 @@ import { markRaw } from 'vue' import { mount } from '@vue/test-utils' import { vi, describe, expect, test } from 'vitest' -import { FIconSnowflake } from '@fighting-design/fighting-icon' +import { FIconSnowflake } from '@fighting-design/fighting-icon' import { FSwitch } from '../index' import { FSvgIcon } from '../../svg-icon' import { FIGHTING_SIZE } from '../../_tokens' @@ -15,9 +15,11 @@ describe('FSwitch', () => { test('modelValue', async () => { const wrapper = mount(FSwitch, { - props: { + props: { modelValue: true, - 'onUpdate:modelValue': (val: boolean) => wrapper.setProps({ modelValue: val }) + 'onUpdate:modelValue': (val: boolean) => { + return wrapper.setProps({ modelValue: val }) + } } }) await wrapper.find('.f-switch__input').trigger('click') @@ -109,7 +111,7 @@ describe('FSwitch', () => { test('onChange', () => { const onChange = vi.fn((val: boolean) => val) const wrapper = mount(FSwitch, { - props: { + props: { onChange, modelValue: true } diff --git a/packages/fighting-design/tabs/src/interface.ts b/packages/fighting-design/tabs/src/interface.ts index 6ea32c8122..76e4623f39 100644 --- a/packages/fighting-design/tabs/src/interface.ts +++ b/packages/fighting-design/tabs/src/interface.ts @@ -26,7 +26,7 @@ export type TabsJustifyContent = /** * 切换前的回调类型 * - * @param { string | number } name 标签的 name + * @param { string | number } name 标签的 name */ export type TabsSwitch = (name: TabsModelValue) => boolean | void