Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Jun 20, 2024
1 parent 5281052 commit 1cc2cda
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/json/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,4 @@
"url": "components/confirm-box"
}
]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"eslint --fix"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const data = {

test('objectEntries', () => {
/**
* @see toStrictEqual https://cn.vitest.dev/api/expect.html#tostrictequal
*/
* @see toStrictEqual https://cn.vitest.dev/api/expect.html#tostrictequal
*/
expect(objectEntries(data)).toStrictEqual([
['a', 1],
['b', 2],
Expand Down
5 changes: 4 additions & 1 deletion packages/fighting-design/_utils/props/__test__/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ test('setStringProp', () => {
})

test('setStringNumberProp', () => {
expect(setStringNumberProp('123')).toStrictEqual({ type: [String, Number], default: '123' })
expect(setStringNumberProp('123')).toStrictEqual({
type: [String, Number],
default: '123'
})
expect(setStringNumberProp()).toStrictEqual({ type: [String, Number], default: void 0 })
expect(setStringNumberProp(222)).toStrictEqual({ type: [String, Number], default: 222 })
})
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('toString', () => {
expect(toString([])).toBe('[object Array]')
expect(toString({})).toBe('[object Object]')
expect(toString((): number => 1)).toBe('[object Function]')
expect(toString(new Date)).toBe('[object Date]')
expect(toString(new Date())).toBe('[object Date]')
expect(toString(Symbol(1))).toBe('[object Symbol]')
expect(toString(null)).toBe('[object Null]')
expect(toString(undefined)).toBe('[object Undefined]')
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/_utils/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isString, isNumber } from '..'

// #region 保留小数点后 no 位
/**
*
*
* 保留小数点后 no 位
*
* @see Number.prototype.toFixed() https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ describe('DropdownItem', () => {
const fn = vi.fn()
const wrapper = mount(FDropdownItem, {
props: {
onClick() {
onClick () {
fn('onClick')
}
},
}
})
wrapper.trigger('click')
expect(fn.mock.calls[0]).toEqual(['onClick'])
Expand All @@ -54,7 +54,7 @@ describe('DropdownItem', () => {
global: {
provide: {
[TRIGGER_CLOSE_KEY as symbol]: {
close() {
close () {
fn('close')
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
},
"homepage": "https://fighting.tianyuhao.cn",
"repository": "https://github.com/FightingDesign/fighting-design"
}
}
7 changes: 5 additions & 2 deletions packages/fighting-design/select/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ export type SelectChange = (

/**
* 值在改变之前的回调类型
*
*
* @param { string | number } value 需要改变的值
* @param { string | number } label 需要改变的标签
*/
export type SelectBeforeChange = (value: SelectModelValue, label: SelectModelValue) => Promise<boolean>
export type SelectBeforeChange = (
value: SelectModelValue,
label: SelectModelValue
) => Promise<boolean>

/**
* 提供给子组件注入的依赖项类型接口
Expand Down
7 changes: 6 additions & 1 deletion packages/fighting-design/select/src/props.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { setBooleanProp, setFunctionProp, setStringProp } from '../../_utils'
import { FIGHTING_SIZE } from '../../_tokens'
import type { ExtractPropTypes, InjectionKey, PropType } from 'vue'
import type { SelectProvide, SelectModelValue, SelectChange, SelectBeforeChange } from './interface'
import type {
SelectProvide,
SelectModelValue,
SelectChange,
SelectBeforeChange
} from './interface'
import type { FightingSize } from '../../_interface'

export const Props = {
Expand Down

0 comments on commit 1cc2cda

Please sign in to comment.