Skip to content

Commit

Permalink
feat: 更新 f-swap 组件 on-change 方法参数接收顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Dec 11, 2023
1 parent 2547e0a commit 08deb49
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md)

- 更新 `f-menu` 组件 `on-menu-item-click``on-submenu-click` 方法参数接收顺序
- 更新 `f-swap` 组件 `on-change` 方法参数接收顺序

## 0.64.1 (2023-12-01)

Expand Down
2 changes: 1 addition & 1 deletion docs/components/swap.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ type SwapType = 'sound' | 'swap'
### SwapChange
```ts
type SwapChange = (evt: MouseEvent, value: boolean) => void
type SwapChange = (value: boolean, evt: MouseEvent) => void
```
## Contributors
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-design/swap/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type SwapType = 'sound' | 'swap'
/**
* 点击切换执行的回调类型
*
* @param { Object } evt 事件对象
* @param { boolean } value 最新值
* @param { Object } evt 事件对象
*/
export type SwapChange = (evt: MouseEvent, value: boolean) => void
export type SwapChange = (value: boolean, evt: MouseEvent) => void
2 changes: 1 addition & 1 deletion packages/fighting-design/swap/src/swap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
const handelClick = (evt: MouseEvent): void => {
modelValue.value = !modelValue.value
run(prop.onChange, evt, !prop.modelValue)
run(prop.onChange, !prop.modelValue, evt)
}
/** 类名列表 */
Expand Down

0 comments on commit 08deb49

Please sign in to comment.