From 2d713445fda90d637ed44636859ef93ec71ed8f5 Mon Sep 17 00:00:00 2001 From: leejimqiu Date: Wed, 26 Jul 2023 13:10:36 +0800 Subject: [PATCH 01/13] fix(calendar): enable reactive for props --- src/calendar/calendar.vue | 5 +++-- src/calendar/template.vue | 27 +++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/calendar/calendar.vue b/src/calendar/calendar.vue index bac5e08e4..23df5c884 100644 --- a/src/calendar/calendar.vue +++ b/src/calendar/calendar.vue @@ -16,7 +16,7 @@ diff --git a/src/swiper/demos/card.vue b/src/swiper/demos/card.vue index 0c9f7d79f..ff622bd90 100644 --- a/src/swiper/demos/card.vue +++ b/src/swiper/demos/card.vue @@ -22,8 +22,8 @@ const swiperList = [ `${imageCdn}/swiper1.png`, ]; -const handleChange = (index: number) => { - console.log('基础示例,页数变化到》》》', index); +const handleChange = (index: number, context: any) => { + console.log('基础示例,页数变化到》》》', index, context); }; diff --git a/src/swiper/demos/control.vue b/src/swiper/demos/control.vue index cd1b2372b..f9b7228ef 100644 --- a/src/swiper/demos/control.vue +++ b/src/swiper/demos/control.vue @@ -6,7 +6,7 @@ height="192" @change="handleChange" > - + @@ -22,7 +22,7 @@ const swiperList = [ `${imageCdn}/swiper1.png`, ]; -const handleChange = (index: number) => { - console.log('基础示例,页数变化到》》》', index); +const handleChange = (index: number, context: any) => { + console.log('基础示例,页数变化到》》》', index, context); }; diff --git a/src/swiper/demos/custom.vue b/src/swiper/demos/custom.vue index 3e6ff3dde..33a2c6b1b 100644 --- a/src/swiper/demos/custom.vue +++ b/src/swiper/demos/custom.vue @@ -17,7 +17,7 @@ const swiperList = [ `${imageCdn}/swiper1.png`, ]; -const handleChange = (index: number) => { - console.log('基础示例,页数变化到》》》', index); +const handleChange = (index: number, context: any) => { + console.log('基础示例,页数变化到》》》', index, context); }; diff --git a/src/swiper/demos/fraction.vue b/src/swiper/demos/fraction.vue index 580ae4410..61c67a786 100644 --- a/src/swiper/demos/fraction.vue +++ b/src/swiper/demos/fraction.vue @@ -21,7 +21,7 @@ const swiperList = [ `${imageCdn}/swiper1.png`, ]; -const handleChange = (index: number) => { - console.log('基础示例,页数变化到》》》', index); +const handleChange = (index: number, context: any) => { + console.log('基础示例,页数变化到》》》', index, context); }; diff --git a/src/swiper/demos/vertical.vue b/src/swiper/demos/vertical.vue index 40ae4bcb9..e5180f355 100644 --- a/src/swiper/demos/vertical.vue +++ b/src/swiper/demos/vertical.vue @@ -23,7 +23,7 @@ const swiperList = [ `${imageCdn}/swiper2.png`, `${imageCdn}/swiper1.png`, ]; -const handleChange = (index: number) => { - console.log('change: ', index); +const handleChange = (index: number, context: any) => { + console.log('基础示例,页数变化到》》》', index, context); }; diff --git a/src/swiper/swiper.en-US.md b/src/swiper/swiper.en-US.md index 8b62fa029..76ca15a8b 100644 --- a/src/swiper/swiper.en-US.md +++ b/src/swiper/swiper.en-US.md @@ -17,14 +17,14 @@ navigation | Object / Slot / Function | - | Typescript:`SwiperNavigation \| TN nextMargin | String / Number | 0 | \- | N previousMargin | String / Number | 0 | \- | N type | String | default | options:default/card | N -onChange | Function | | Typescript:`(current: number, context: { source: SwiperChangeSource }) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| ''`
| N +onChange | Function | | Typescript:`(current: number, context: { source: SwiperChangeSource }) => void`
[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`
| N onClick | Function | | Typescript:`(index: number) => void`
| N ### Swiper Events name | params | description -- | -- | -- -change | `(current: number, context: { source: SwiperChangeSource })` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| ''`
+change | `(current: number, context: { source: SwiperChangeSource })` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`
click | `(index: number)` | \- ### SwiperNavigation diff --git a/src/swiper/swiper.md b/src/swiper/swiper.md index 93fb0bc9e..4eb73d59c 100644 --- a/src/swiper/swiper.md +++ b/src/swiper/swiper.md @@ -16,14 +16,14 @@ loop | Boolean | true | 是否循环播放 | N navigation | Object / Slot / Function | - | 导航器全部配置。TS 类型:`SwiperNavigation \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N nextMargin | String / Number | 0 | 【开发中】后边距,可用于露出后一项的一小部分。默认单位 `px` | N previousMargin | String / Number | 0 | 【开发中】前边距,可用于露出前一项的一小部分。默认单位 `px` | N -onChange | Function | | TS 类型:`(current: number, context: { source: SwiperChangeSource }) => void`
轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| ''`
| N +onChange | Function | | TS 类型:`(current: number, context: { source: SwiperChangeSource }) => void`
轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`
| N onClick | Function | | TS 类型:`(index: number) => void`
点击轮播项时触发 | N ### Swiper Events 名称 | 参数 | 描述 -- | -- | -- -change | `(current: number, context: { source: SwiperChangeSource })` | 轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| ''`
+change | `(current: number, context: { source: SwiperChangeSource })` | 轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。
`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`
click | `(index: number)` | 点击轮播项时触发 ### SwiperNavigation diff --git a/src/swiper/swiper.vue b/src/swiper/swiper.vue index bd9577f43..249fbe570 100644 --- a/src/swiper/swiper.vue +++ b/src/swiper/swiper.vue @@ -17,8 +17,8 @@