Skip to content

Commit

Permalink
style: 优化格式细节
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed May 6, 2024
1 parent 938a97a commit 056b00b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/fighting-design/_hooks/use-count-down/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface UseCountDownOptions {
}

/**
* useCountDown hook 返回值中currentTime的类型
* useCountDown hook 返回值中 currentTime 的类型
*
* @param { number } total 剩余总时间(单位毫秒)
* @param { number } days 剩余天数
Expand Down
8 changes: 4 additions & 4 deletions packages/fighting-design/count-down/src/count-down.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
/**
* 格式化时间格式
*
* @param format
* @param currentTime
* @param { string } format 需要格式化的时间
* @param { Object } currentTime 时间信息
*/
const formatTimeStr = (format: string, currentTime: CurrentTime): string => {
const { days } = currentTime
Expand All @@ -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 + ''
Expand Down
10 changes: 6 additions & 4 deletions packages/fighting-design/switch/__test__/switch.spec.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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')
Expand Down Expand Up @@ -109,7 +111,7 @@ describe('FSwitch', () => {
test('onChange', () => {
const onChange = vi.fn((val: boolean) => val)
const wrapper = mount(FSwitch, {
props: {
props: {
onChange,
modelValue: true
}
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/tabs/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type TabsJustifyContent =
/**
* 切换前的回调类型
*
* @param { string | number } name 标签的 name
* @param { string | number } name 标签的 name
*/
export type TabsSwitch = (name: TabsModelValue) => boolean | void

Expand Down

0 comments on commit 056b00b

Please sign in to comment.