diff --git a/CHANGELOG.md b/CHANGELOG.md index ca38a5dac2..dcb995f613 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/components/swap.md b/docs/components/swap.md index 091cc6d548..e5f50ad9ed 100644 --- a/docs/components/swap.md +++ b/docs/components/swap.md @@ -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 diff --git a/packages/fighting-design/swap/src/interface.ts b/packages/fighting-design/swap/src/interface.ts index d175dd5f26..a4743cc478 100644 --- a/packages/fighting-design/swap/src/interface.ts +++ b/packages/fighting-design/swap/src/interface.ts @@ -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 diff --git a/packages/fighting-design/swap/src/swap.vue b/packages/fighting-design/swap/src/swap.vue index 366ef18318..57427af5d3 100644 --- a/packages/fighting-design/swap/src/swap.vue +++ b/packages/fighting-design/swap/src/swap.vue @@ -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) } /** 类名列表 */