Browse Source

fix: calendar(v4) 修改放大系数 (#2000)

lkjh3214 3 years ago
parent
commit
f695776384

+ 1 - 1
src/packages/__VUE/backtop/doc.en-US.md

@@ -217,7 +217,7 @@ app.use(Backtop);
 ### Events
 | Event  | Description     | Arguments    |
 |-------|----------|-------------|
-| click | Emitted when component is clicked | event: MouseEvent |
+| click | Emitted when component is clicked | `event: MouseEvent` |
 
 ### Slots
 

+ 1 - 1
src/packages/__VUE/backtop/doc.md

@@ -221,7 +221,7 @@ app.use(Backtop);
 ### Events
 | 名称  | 说明     | 回调参数    |
 |-------|----------|-------------|
-| click | 按钮点击时触发事件 | event: MouseEvent |
+| click | 按钮点击时触发事件 | `event: MouseEvent` |
 
 ### Slots
 

+ 1 - 1
src/packages/__VUE/backtop/doc.taro.md

@@ -209,7 +209,7 @@ export default {
 ### Events
 | 名称  | 说明     | 回调参数    |
 |-------|----------|-------------|
-| click | 按钮点击时触发事件 | event: MouseEvent |
+| click | 按钮点击时触发事件 | `event: MouseEvent` |
 
 ### Slots
 

+ 4 - 4
src/packages/__VUE/button/doc.en-US.md

@@ -194,9 +194,9 @@ The color of the button can be customized through the color property.
 
 | Attribute     | Description                                                         | Type    | Default    |
 | -------- | ------------------------------------------------------------ | ------- | --------- |
-| type     | Can be set to  `primary` `info` `warning` `danger` `success` | string  | `default` |
-| size     | 	Can be set to `large` `small` `mini`                        | string  | `normal`  |
-| shape    | Can be set to `square`                                      | string  | `round`   |
+| type     | Can be set to  `primary` `info` `warning` `danger` `success` `default` | string  | `default` |
+| size     | 	Can be set to `large` `small` `mini` `normal`                      | string  | `normal`  |
+| shape    | Can be set to `square` `round`                                          | string  | `round`   |
 | color    | Button color, support incoming linear-gradient gradient color                    | string  | -         |
 | plain    | Whether to be plain button     | boolean | `false`   |
 | disabled | Whether to disable button         | boolean | `false`   |
@@ -207,7 +207,7 @@ The color of the button can be customized through the color property.
 
 | Event | Description           | Arguments          |
 | ------ | -------------- | ----------------- |
-| click  | Emitted when component is clicked | event: MouseEvent |
+| click  | Emitted when component is clicked | `event: MouseEvent` |
 
 ## Theming
 

+ 6 - 6
src/packages/__VUE/button/doc.md

@@ -193,11 +193,11 @@ app.use(Button);
 
 | 参数     | 说明                                                         | 类型    | 默认值    |
 | -------- | ------------------------------------------------------------ | ------- | --------- |
-| type     | 类型,可选值为 `primary` `info` `warning` `danger` `success` | string  | `default` |
-| size     | 尺寸,可选值为 `large` `small` `mini`                        | string  | `normal`  |
-| shape    | 形状,可选值为 `square`                                      | string  | `round`   |
-| color    | 按钮颜色,支持传入 linear-gradient 渐变色                    | string  | -         |
-| plain    | 是否为朴素按钮                                               | boolean | `false`   |
+| type     | 类型,可选值为 `primary` `info` `warning` `danger` `success` `default` | string  | `default` |
+| size     | 尺寸,可选值为 `large` `small` `mini` `normal`                         | string  | `normal`  |
+| shape    | 形状,可选值为 `square` `round`                                        | string  | `round`   |
+| color    | 按钮颜色,支持传入 linear-gradient 渐变色                                | string  | -         |
+| plain    | 是否为朴素按钮                                                         | boolean | `false`   |
 | disabled | 是否禁用按钮                                                 | boolean | `false`   |
 | block    | 是否为块级元素                                               | boolean | `false`   |
 | loading  | 按钮 loading 状态                                            | boolean | `false`   |
@@ -213,7 +213,7 @@ app.use(Button);
 
 | 事件名 | 说明           | 回调参数          |
 | ------ | -------------- | ----------------- |
-| click  | 点击按钮时触发 | event: MouseEvent |
+| click  | 点击按钮时触发 |`event: MouseEvent` |
 
 
 

+ 4 - 4
src/packages/__VUE/button/doc.taro.md

@@ -191,9 +191,9 @@ app.use(Button);
 
 | 参数     | 说明                                                         | 类型    | 默认值    |
 | -------- | ------------------------------------------------------------ | ------- | --------- |
-| type     | 类型,可选值为 `primary` `info` `warning` `danger` `success` | string  | `default` |
-| size     | 尺寸,可选值为 `large` `small` `mini`                        | string  | `normal`  |
-| shape    | 形状,可选值为 `square`                                      | string  | `round`   |
+| type     | 类型,可选值为 `primary` `info` `warning` `danger` `success` `default` | string  | `default` |
+| size     | 尺寸,可选值为 `large` `small` `mini` `normal`                       | string  | `normal`  |
+| shape    | 形状,可选值为 `square` `round`                                      | string  | `round`   |
 | color    | 按钮颜色,支持传入 linear-gradient 渐变色                    | string  | -         |
 | plain    | 是否为朴素按钮                                               | boolean | `false`   |
 | disabled | 是否禁用按钮                                                 | boolean | `false`   |
@@ -205,7 +205,7 @@ app.use(Button);
 
 | 事件名 | 说明           | 回调参数          |
 | ------ | -------------- | ----------------- |
-| click  | 点击按钮时触发 | event: MouseEvent |
+| click  | 点击按钮时触发 | `event: MouseEvent` |
 
 ## 主题定制
 

+ 5 - 6
src/packages/__VUE/calendar/doc.en-US.md

@@ -596,11 +596,11 @@ export default {
 | Attribute              | Description                                  | Type            | Default  |
 |-------------------|---------------------------------------------------|-----------------|-----------------|
 | v-model:visible   | whether to show                  | boolean         | `false`           |
-| type              | Calendar type :'one' 'range' 'multiple'    | string          | `one`           |
+| type              | Calendar type :`one` `range` `multiple`    | string          | `one`           |
 | poppable          | Whether to display the pop-up window                                  | boolean         | `true`            |
 | is-auto-back-fill | Automatic backfill                                          | boolean         | `false`           |
 | title             | whether to show title                                          | string          | `Calendar`      |
-| default-value     | Default value, select single date : `string`,other: `array` | string 、 array | `null`            |
+| default-value     | Default value, select single date : `string`,other: `string[]` | string \| string[] | `null`            |
 | start-date        | The start date            | string          | `Today`            |
 | end-date          | The end date            | string          | `365 days from today` |
 | show-today          | Whether to show today's mark               | boolean          | `true` |
@@ -616,9 +616,9 @@ export default {
 
 | Event | Description                         | Arguments                     |
 |--------|------------------------------|------------------------------|
-| choose | Triggered after selection or by clicking the confirm button | Array of dates (including year, month, day and week) |
+| choose | Triggered after selection or by clicking the confirm button,Array of dates (including year, month, day and week) | `(string \| string[])[]` |
 | close  | Triggered when closed                   | -                            |
-| select  | Triggered after click/select             |  Day:object                          |
+| select  | Triggered after click/select             |  `(string \| string[])[]`                          |
 
 
 
@@ -638,8 +638,7 @@ Through [ref](https://vuejs.org/guide/essentials/template-refs.html), you can ge
 
 | Name | Description             | Arguments          |
 |--------|------------------|---------------|
-| scrollToDate   | Scroll to the month of the specified date | string:'2021-12-30' |
-
+| scrollToDate   | Scroll to the month of the specified date:'2021-12-30' | `string` |
 ## Theming
 
 ### CSS Variables

+ 10 - 10
src/packages/__VUE/calendar/doc.md

@@ -589,11 +589,11 @@ export default {
 | 字段              | 说明                                              | 类型            | 默认值          |
 |-------------------|---------------------------------------------------|-----------------|-----------------|
 | v-model:visible   | 是否可见                                          | boolean         | `false`           |
-| type              | 类型,日期单择'one',区间选择'range',日期多选'multiple'    | string          | '`one`'           |
+| type              | 类型,日期单择`one`,区间选择`range`,日期多选`multiple`    | string       | '`one`'           |
 | poppable          | 是否弹窗状态展示                                  | boolean         | `true`            |
 | is-auto-back-fill | 自动回填                                          | boolean         | `false`           |
 | title             | 显示标题                                          | string          | `日期选择`      |
-| default-value     | 默认值,单个日期选择 string,其他为 Array  | string 、 array | `null`            |
+| default-value     | 默认值,单个日期选择 `string`,其他为 `string[]`  | string \| string[] | `null`            |
 | start-date        | 开始日期         | string          | `今天`            |
 | end-date          | 结束日期              | string          | `距离今天 365 天` |
 | show-today          | 是否展示今天标记               | boolean          | `true` |
@@ -607,11 +607,11 @@ export default {
 
 ### Events
 
-| 事件名 | 说明                         | 回调参数                     |
-|--------|------------------------------|------------------------------|
-| choose | 选择之后或是点击确认按钮触发 | 日期数组(包含年月日和星期) |
-| close  | 关闭时触发                   | -                            |
-| select  | 点击/选择后触发              |  Day:object                          |
+| 事件名   | 说明                          | 回调参数                                           |
+|-------- |------------------------------|---------------------------------------------------|
+| choose  | 选择之后或是点击确认按钮触发,日期数组(包含年月日和星期)  | `(string \| string[])[]`        |
+| close   | 关闭时触发                                         | -                             |
+| select  | 点击/选择后触发                                     |  `(string \| string[])[]`       |
 
 
 
@@ -629,9 +629,9 @@ export default {
 通过 [ref](https://vuejs.org/guide/essentials/template-refs.html) 可以获取到 Calendar 实例并调用实例方法。
 
 
-| 方法名 | 说明             | 参数          |
-|--------|------------------|---------------|
-| scrollToDate   | 滚动到指定日期所在月 | string:'2021-12-30' |
+| 方法名          | 说明               | 参数          |
+|----------------|-------------------|---------------|
+| scrollToDate   | 滚动到指定日期所在月,如:'2021-12-30' | `string` |
 
 ## 主题定制
 

+ 7 - 8
src/packages/__VUE/calendar/doc.taro.md

@@ -589,13 +589,13 @@ export default {
 | 字段              | 说明                                              | 类型            | 默认值          |
 |-------------------|---------------------------------------------------|-----------------|-----------------|
 | v-model:visible   | 是否可见                                          | boolean         | `false`           |
-| type              | 类型,日期单择'one',区间选择'range',日期多选'multiple'    | string          | `one`          |
+| type              | 类型,日期单择`one`,区间选择`range`,日期多选`multiple`    | string       | '`one`'           |
 | poppable          | 是否弹窗状态展示                                  | boolean         | `true`            |
 | is-auto-back-fill | 自动回填                                          | boolean         | `false`           |
 | title             | 显示标题                                          | string          | `日期选择`      |
-| default-value     | 默认值,单个日期选择 string,其他为 Array  | string 、 Array | `null`            |
-| start-date        | 开始日期         | string          | 今天            |
-| end-date          | 结束日期              | string          | 距离今天 365 天 |
+| default-value     | 默认值,单个日期选择 `string`,其他为 `string[]`  | string  \| string[] | `null`            |
+| start-date        | 开始日期         | string          | `今天`            |
+| end-date          | 结束日期              | string          | `距离今天 365 天` |
 | show-today          | 是否展示今天标记               | boolean          | `true` |
 | start-text         | 范围选择,开始信息文案               | string          | `开始` |
 | end-text         | 范围选择,结束信息文案               | string          | `结束` |
@@ -609,9 +609,9 @@ export default {
 
 | 事件名 | 说明                         | 回调参数                     |
 |--------|------------------------------|------------------------------|
-| choose | 选择之后或是点击确认按钮触发 | 日期数组(包含年月日和星期) |
+| choose | 选择之后或是点击确认按钮触发,日期数组(包含年月日和星期) | `(string \| string[])[]` |
 | close  | 关闭时触发                   | -                            |
-| select  | 点击/选择后触发              |  Day:object                          |
+| select  | 点击/选择后触发              |  `(string \| string[])[]`                          |
 
 
 
@@ -631,8 +631,7 @@ export default {
 
 | 方法名 | 说明             | 参数          |
 |--------|------------------|---------------|
-| scrollToDate   | 滚动到指定日期所在月 | string:'2021-12-30' |
-
+| scrollToDate   | 滚动到指定日期所在月,如:'2021-12-30' | `string` |
 
 ## 主题定制
 

+ 1 - 1
src/packages/__VUE/calendar/index.scss

@@ -65,7 +65,7 @@
       line-height: 44px;
     }
     .nut-calendar__header-slot {
-      height: 24px;
+      min-height: 24px;
     }
     .nut-calendar__header-subtitle {
       padding: 7px 0;

+ 3 - 3
src/packages/__VUE/calendaritem/index.taro.vue

@@ -277,7 +277,7 @@ export default create({
       if (getClass(day, month) != `${state.dayPrefix}--disabled`) {
         const { type } = props;
         let days = [...month.curData];
-        days[2] = typeof day.day == 'number' ? Utils.getNumTwoBit(day.day) : day.day;
+        days[2] = Utils.getNumTwoBit(Number(day.day));
         days[3] = `${days[0]}-${days[1]}-${days[2]}`;
         days[4] = Utils.getWhatDay(+days[0], +days[1], +days[2]);
         if (type == 'multiple') {
@@ -763,12 +763,12 @@ export default create({
       Taro.getSystemInfo({
         success(res) {
           let scale = 2;
-          let screenWidth = res.screenWidth;
           let toFixed = 3;
           if (TARO_ENV === Taro.ENV_TYPE.WEB) {
             toFixed = 5;
           }
-          scale = Number((screenWidth / 750).toFixed(toFixed));
+          let fontSize = document.documentElement.style.fontSize;
+          scale = Number((Number.parseInt(fontSize) / 40).toFixed(toFixed));
           scalePx.value = scale;
           initData();
         }

+ 1 - 2
src/packages/__VUE/calendaritem/index.vue

@@ -274,7 +274,7 @@ export default create({
       if (getClass(day, month) != `${state.dayPrefix}--disabled`) {
         const { type } = props;
         let days = [...month.curData];
-        days[2] = typeof day.day == 'number' ? Utils.getNumTwoBit(day.day) : day.day;
+        days[2] = Utils.getNumTwoBit(Number(day.day));
         days[3] = `${days[0]}-${days[1]}-${days[2]}`;
         days[4] = Utils.getWhatDay(+days[0], +days[1], +days[2]);
         if (type == 'multiple') {
@@ -554,7 +554,6 @@ export default create({
           }
         });
       }
-
       setDefaultRange(monthsNum, current);
       state.currentIndex = current;
       state.yearMonthTitle = state.monthsData[state.currentIndex].title;

+ 1 - 1
src/packages/__VUE/range/doc.en-US.md

@@ -408,7 +408,7 @@ export default {
 
 | Event             | Description                     | Arguments        |
 | ------------------ | ------------------------ | --------------- |
-| change             | Triggered when the progress changes and the drag is over | value: progress |
+| change             | Triggered when the progress changes and the drag is over | `value: number \| number[]` |
 | drag-start         | Triggered when dragging starts           | -               |
 | drag-end           | Triggered when the drag is over           | -               |
 

+ 1 - 1
src/packages/__VUE/range/doc.md

@@ -410,7 +410,7 @@ export default {
 
 | 事件名             | 说明                     | 回调参数        |
 | ------------------ | ------------------------ | --------------- |
-| change             | 进度变化且结束拖动后触发 | value: 当前进度 |
+| change             | 进度变化且结束拖动后触发 | `value: number \| number[]` |
 | drag-start         | 开始拖动时触发           | -               |
 | drag-end           | 结束拖动时触发           | -               |
 

+ 1 - 1
src/packages/__VUE/range/doc.taro.md

@@ -388,7 +388,7 @@ export default {
 
 | 事件名             | 说明                     | 回调参数        |
 | ------------------ | ------------------------ | --------------- |
-| change             | 进度变化且结束拖动后触发 | value: 当前进度 |
+| change             | 进度变化且结束拖动后触发 | `value: number \| number[]` |
 | drag-start         | 开始拖动时触发           | -               |
 | drag-end           | 结束拖动时触发           | -               |
 

+ 1 - 1
src/packages/__VUE/trendarrow/doc.md

@@ -153,7 +153,7 @@ app.use(TrendArrow);
 
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
-| rate         | 数值,大于0时箭头向上,小于0时箭头向下    | number | `-`                |
+| rate         | 数值,大于0时箭头向上,小于0时箭头向下    | number | -                |
 | digits         | 小数位精度               | number | `2`               |
 | show-sign         | 是否显示加减号               | boolean | `false`               |
 | show-zero         | 是否显示 0               | boolean | `false`               |

+ 1 - 1
src/packages/__VUE/trendarrow/doc.taro.md

@@ -153,7 +153,7 @@ app.use(TrendArrow);
 
 | 参数         | 说明                             | 类型   | 默认值           |
 |--------------|----------------------------------|--------|------------------|
-| rate         | 数值,大于0时箭头向上,小于0时箭头向下    | number | `-`|
+| rate         | 数值,大于0时箭头向上,小于0时箭头向下    | number | - |
 | digits         | 小数位精度               | number | `2`               |
 | show-sign         | 是否显示加减号               | boolean | `false`               |
 | show-zero         | 是否显示 0               | boolean | `false`               |

+ 10 - 10
src/packages/__VUE/watermark/doc.md

@@ -113,18 +113,18 @@ app.use(Watermark);
 |--------------|----------------------------------|--------|------------------|
 | width       | 水印的宽度                                           | number         | `120`                |
 | height      | 水印的高度                                           | number           | `64`                 |
-| rotate      | 水印绘制时,旋转的角度                  | number           | `-22`                |
-| image       | 图片源,建议导出 2 倍或 3 倍图,优先使用图片渲染水印 | string           | -                    |
-| image-width  | 图片宽度                                             | number           | `120`                |
-| image-height | 图片高度                                             | number           | `64`                 |
-| z-index      | 追加的水印元素的 z-index                             | number           | `2000`               |
-| content     | 水印文字内容                                         | string           | -                    |
+| rotate      | 水印绘制时,旋转的角度                                  | number           | `-22`                |
+| image       | 图片源,建议导出 2 倍或 3 倍图,优先使用图片渲染水印        | string           | -                    |
+| image-width  | 图片宽度                                            | number           | `120`                |
+| image-height | 图片高度                                            | number           | `64`                 |
+| z-index      | 追加的水印元素的 z-index                              | number           | `2000`               |
+| content     | 水印文字内容                                          | string           | -                    |
 | font-color   | 水印文字颜色                                         | string           | `rgba(0, 0, 0, .15)` |
 | font-size    | 文字大小                                             | string \| number | `16`                 |
-| gap-x        | 水印之间的水平间距                                   | number           | `24`                 |
-| gap-y       | 水印之间的垂直间距                                   | number           | `48`                 |
-| full-page    | 是否覆盖整个页面                                     | boolean          | `true`               |
-| font-family  | 水印文字字体                                     | boolean          | `true`               |
+| gap-x        | 水印之间的水平间距                                     | number           | `24`                 |
+| gap-y       | 水印之间的垂直间距                                      | number           | `48`                 |
+| full-page    | 是否覆盖整个页面                                      | boolean          | `true`               |
+| font-family  | 水印文字字体                                          | boolean          | `true`               |
 
 ## 主题定制
 

+ 8 - 8
src/packages/__VUE/watermark/doc.taro.md

@@ -113,18 +113,18 @@ app.use(Watermark);
 |--------------|----------------------------------|--------|------------------|
 | width       | 水印的宽度                                           | number           | `120`                |
 | height      | 水印的高度                                           | number           | `64`                 |
-| rotate      | 水印绘制时,旋转的角度                  | number           | `-22`                |
-| image       | 图片源,建议导出 2 倍或 3 倍图,优先使用图片渲染水印 | string           | -                    |
+| rotate      | 水印绘制时,旋转的角度                                  | number           | `-22`                |
+| image       | 图片源,建议导出 2 倍或 3 倍图,优先使用图片渲染水印        | string           | -                    |
 | image-width  | 图片宽度                                             | number           | `120`                |
 | image-height | 图片高度                                             | number           | `64`                 |
-| z-index      | 追加的水印元素的 z-index                             | number           | `2000`               |
-| content     | 水印文字内容                                         | string           | -                    |
+| z-index      | 追加的水印元素的 z-index                               | number           | `2000`               |
+| content     | 水印文字内容                                          | string           | -                    |
 | font-color   | 水印文字颜色                                         | string           | `rgba(0, 0, 0, .15)` |
 | font-size    | 文字大小                                             | string \| number | `16`                 |
-| gap-x        | 水印之间的水平间距                                   | number           | `24`                 |
-| gap-y       | 水印之间的垂直间距                                   | number           | `48`                 |
-| full-page    | 是否覆盖整个页面                                     | boolean          | `true`               |
-| font-family  | 水印文字字体                                     | boolean          | `true`               |
+| gap-x        | 水印之间的水平间距                                      | number           | `24`                 |
+| gap-y       | 水印之间的垂直间距                                      | number           | `48`                 |
+| full-page    | 是否覆盖整个页面                                       | boolean          | `true`               |
+| font-family  | 水印文字字体                                           | boolean          | `true`               |
 
 ## 主题定制