diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index 657beb176..24771359a 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -10,6 +10,21 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/). - Minor version:released every one to two months, including backwards compatible features. - Major version:including breaking changes and new features. +### [v2.9.2](https://github.com/youzan/vant/compare/v2.9.1...v2.9.2) + +`2020-07-14` + +**Feature** + +- Calendar: add first-day-of-week prop [#6468](https://github.com/youzan/vant/issues/6468) +- DatetimePicker: add columns-order prop [#6672](https://github.com/youzan/vant/issues/6672) [#6768](https://github.com/youzan/vant/issues/6768) + +**Bug Fixes** + +- Tab: should not trigger route when disabled [#6782](https://github.com/youzan/vant/issues/6782) +- Sku: fix label color [#6771](https://github.com/youzan/vant/issues/6771) +- Sku: image cell word wrap [#6777](https://github.com/youzan/vant/issues/6777) + ### [v2.9.1](https://github.com/youzan/vant/compare/v2.9.0...v2.9.1) `2020-07-12` diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index 0b34d689d..419bc9209 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -10,6 +10,21 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - 次版本号:每隔一至二个月发布,包含新特性和较大的功能更新,向下兼容。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 +### [v2.9.2](https://github.com/youzan/vant/compare/v2.9.1...v2.9.2) + +`2020-07-14` + +**Feature** + +- Calendar: 新增 first-day-of-week 属性 [#6468](https://github.com/youzan/vant/issues/6468) +- DatetimePicker: 新增 columns-order 属性 [#6672](https://github.com/youzan/vant/issues/6672) [#6768](https://github.com/youzan/vant/issues/6768) + +**Bug Fixes** + +- Tab: 修复标签禁用时仍会触发路由跳转的问题 [#6782](https://github.com/youzan/vant/issues/6782) +- Sku: 修复留言区域 label 颜色不一致的问题 [#6771](https://github.com/youzan/vant/issues/6771) +- Sku: 修复留言区域 label 里包含较长的单词时未自动换行的问题 [#6777](https://github.com/youzan/vant/issues/6777) + ### [v2.9.1](https://github.com/youzan/vant/compare/v2.9.0...v2.9.1) `2020-07-12` diff --git a/package.json b/package.json index 6d077f0f7..3625229e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "2.9.1", + "version": "2.9.2", "description": "Mobile UI Components built on Vue", "main": "lib/index.js", "module": "es/index.js", diff --git a/src/calendar/README.md b/src/calendar/README.md index 3df673156..480df2a4f 100644 --- a/src/calendar/README.md +++ b/src/calendar/README.md @@ -2,7 +2,7 @@ ### Intro -Calendar component for selecting dates or date ranges +Calendar component for selecting dates or date ranges. ### Install @@ -17,7 +17,7 @@ Vue.use(Calendar); ### Select Single Date -The `confirm` event will be triggered after the date selection is completed +The `confirm` event will be triggered after the date selection is completed. ```html @@ -108,7 +108,7 @@ Set `show-confirm` to `false` to hide the confirm button. In this case, the `con ### Custom Color -Use `color` prop to custom calendar color +Use `color` prop to custom calendar color. ```html @@ -116,7 +116,7 @@ Use `color` prop to custom calendar color ### Custom Date Range -Use `min-date` and `max-date` to custom date range +Use `min-date` and `max-date` to custom date range. ```html @@ -136,7 +136,7 @@ export default { ### Custom Confirm Text -Use `confirm-text` and `confirm-disabled-text` to custom confirm text +Use `confirm-text` and `confirm-disabled-text` to custom confirm text. ```html @@ -186,7 +186,7 @@ export default { ### Custom Position -Use `position` to custom popup position,can be set to `top`、`left`、`right` +Use `position` to custom popup position,can be set to `top`、`left`、`right`. ```html @@ -194,12 +194,20 @@ Use `position` to custom popup position,can be set to `top`、`left`、`right` ### Max Range -When selecting a date range, you can use the `max-range` prop to specify the maximum number of selectable days +When selecting a date range, you can use the `max-range` prop to specify the maximum number of selectable days. ```html ``` +### Custom First Day Of Week + +Use `first-day-of-week` to custom the start day of week + +```html + +``` + ### Tiled display Set `poppable` to `false`, the calendar will be displayed directly on the page instead of appearing as a popup @@ -235,6 +243,7 @@ Set `poppable` to `false`, the calendar will be displayed directly on the page i | show-confirm | Whether to show confirm button | _boolean_ | `true` | | confirm-text | Confirm button text | _string_ | `Confirm` | | confirm-disabled-text | Confirm button text when disabled | _string_ | `Confirm` | +| first-day-of-week `v2.9.2` | Set the start day of week | _0-6_ | `0` | ### Poppable Props diff --git a/src/calendar/README.zh-CN.md b/src/calendar/README.zh-CN.md index 6b7e6c2f9..32ff0cfbb 100644 --- a/src/calendar/README.zh-CN.md +++ b/src/calendar/README.zh-CN.md @@ -2,7 +2,7 @@ ### 介绍 -日历组件用于选择日期或日期区间,2.4 版本开始支持此组件 +日历组件用于选择日期或日期区间,2.4 版本开始支持此组件。 ### 引入 @@ -17,7 +17,7 @@ Vue.use(Calendar); ### 选择单个日期 -下面演示了结合单元格来使用日历组件的用法,日期选择完成后会触发`confirm`事件 +下面演示了结合单元格来使用日历组件的用法,日期选择完成后会触发 `confirm` 事件。 ```html @@ -46,7 +46,7 @@ export default { ### 选择多个日期 -设置`type`为`multiple`后可以选择多个日期,此时`confirm`事件返回的 date 为数组结构,数组包含若干个选中的日期。 +设置 `type` 为 `multiple` 后可以选择多个日期,此时 `confirm` 事件返回的 date 为数组结构,数组包含若干个选中的日期。 ```html @@ -72,7 +72,7 @@ export default { ### 选择日期区间 -设置`type`为`range`后可以选择日期区间,此时`confirm`事件返回的 date 为数组结构,数组第一项为开始时间,第二项为结束时间。 +设置 `type` 为 `range` 后可以选择日期区间,此时 `confirm` 事件返回的 date 为数组结构,数组第一项为开始时间,第二项为结束时间。 ```html @@ -102,7 +102,7 @@ export default { ### 快捷选择 -将`show-confirm`设置为`false`可以隐藏确认按钮,这种情况下选择完成后会立即触发`confirm`事件 +将 `show-confirm` 设置为 `false` 可以隐藏确认按钮,这种情况下选择完成后会立即触发 `confirm` 事件。 ```html @@ -110,7 +110,7 @@ export default { ### 自定义颜色 -通过`color`属性可以自定义日历的颜色,对选中日期和底部按钮生效 +通过 `color` 属性可以自定义日历的颜色,对选中日期和底部按钮生效。 ```html @@ -118,7 +118,7 @@ export default { ### 自定义日期范围 -通过`min-date`和`max-date`定义日历的范围 +通过 `min-date` 和 `max-date` 定义日历的范围。 ```html @@ -138,7 +138,7 @@ export default { ### 自定义按钮文字 -通过`confirm-text`设置按钮文字,通过`confirm-disabled-text`设置按钮禁用时的文字 +通过 `confirm-text` 设置按钮文字,通过 `confirm-disabled-text` 设置按钮禁用时的文字。 ```html @@ -188,7 +188,7 @@ export default { ### 自定义弹出位置 -通过`position`属性自定义弹出层的弹出位置,可选值为`top`、`left`、`right` +通过 `position` 属性自定义弹出层的弹出位置,可选值为 `top`、`left`、`right`。 ```html @@ -196,15 +196,23 @@ export default { ### 日期区间最大范围 -选择日期区间时,可以通过`max-range`属性来指定最多可选天数,选择的范围超过最多可选天数时,会弹出相应的提示文案 +选择日期区间时,可以通过 `max-range` 属性来指定最多可选天数,选择的范围超过最多可选天数时,会弹出相应的提示文案。 ```html ``` +### 自定义周起始日 + +通过 `first-day-of-week` 属性设置一周从哪天开始。 + +```html + +``` + ### 平铺展示 -将`poppable`设置为`false`,日历会直接展示在页面内,而不是以弹层的形式出现 +将 `poppable` 设置为 `false`,日历会直接展示在页面内,而不是以弹层的形式出现。 ```html - {weekdays.map((item) => ( + {renderWeekDays.map((item) => ( {item} ))} diff --git a/src/calendar/components/Month.js b/src/calendar/components/Month.js index 50280034f..ef58563c8 100644 --- a/src/calendar/components/Month.js +++ b/src/calendar/components/Month.js @@ -27,6 +27,7 @@ export default createComponent({ allowSameDay: Boolean, showSubtitle: Boolean, showMonthTitle: Boolean, + firstDayOfWeek: Number, }, data() { @@ -41,7 +42,15 @@ export default createComponent({ }, offset() { - return this.date.getDay(); + const { firstDayOfWeek } = this; + + const realDay = this.date.getDay(); + + if (!firstDayOfWeek) { + return realDay; + } + + return (realDay + 7 - this.firstDayOfWeek) % 7; }, totalDay() { diff --git a/src/calendar/demo/index.vue b/src/calendar/demo/index.vue index 19f4ab4d0..5b2c7a767 100644 --- a/src/calendar/demo/index.vue +++ b/src/calendar/demo/index.vue @@ -81,6 +81,12 @@ :value="formatRange(date.maxRange)" @click="show('range', 'maxRange')" /> + + @@ -108,6 +114,7 @@ :show-confirm="showConfirm" :confirm-text="confirmText" :confirm-disabled-text="confirmDisabledText" + :first-day-of-week="firstDayOfWeek" @confirm="onConfirm" /> @@ -139,6 +146,7 @@ export default { customPosition: '自定义弹出位置', customCalendar: '自定义日历', confirmDisabledText: '请选择结束时间', + firstDayOfWeek: '自定义周起始日', tiledDisplay: '平铺展示', }, 'en-US': { @@ -161,6 +169,7 @@ export default { customDayText: 'Custom Day Text', customPosition: 'Custom Position', customCalendar: 'Custom Calendar', + firstDayOfWeek: 'Custom First Day Of Week', confirmDisabledText: 'Select End Time', tiledDisplay: 'Tiled display', }, @@ -195,6 +204,7 @@ export default { tiledMaxDate: new Date(2012, 2, 20), confirmText: undefined, confirmDisabledText: undefined, + firstDayOfWeek: 0, }; }, @@ -210,6 +220,7 @@ export default { this.showConfirm = true; this.confirmText = undefined; this.confirmDisabledText = undefined; + this.firstDayOfWeek = 0; }, show(type, id) { @@ -246,6 +257,9 @@ export default { case 'maxRange': this.maxRange = 3; break; + case 'firstDayOfWeek': + this.firstDayOfWeek = 1; + break; } }, diff --git a/src/calendar/index.js b/src/calendar/index.js index e05b3a13a..591e64a2c 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -35,6 +35,13 @@ export default createComponent({ allowSameDay: Boolean, closeOnPopstate: Boolean, confirmDisabledText: String, + firstDayOfWeek: { + type: [Number, String], + default: 0, + validator: (val) => { + return val >= 0 && val <= 6; + }, + }, type: { type: String, default: 'single', @@ -137,6 +144,10 @@ export default createComponent({ return !currentDate; }, + + dayOffset() { + return this.firstDayOfWeek ? this.firstDayOfWeek % 7 : 0; + }, }, watch: { @@ -379,6 +390,7 @@ export default createComponent({ showSubtitle={this.showSubtitle} allowSameDay={this.allowSameDay} showMonthTitle={showMonthTitle} + firstDayOfWeek={this.dayOffset} onClick={this.onClickDay} /> ); @@ -432,6 +444,7 @@ export default createComponent({ scopedSlots={{ title: () => this.slots('title'), }} + firstDayOfWeek={this.dayOffset} />
{this.months.map(this.genMonth)} diff --git a/src/calendar/test/__snapshots__/demo.spec.js.snap b/src/calendar/test/__snapshots__/demo.spec.js.snap index 33cd782f9..2e5ac8a76 100644 --- a/src/calendar/test/__snapshots__/demo.spec.js.snap +++ b/src/calendar/test/__snapshots__/demo.spec.js.snap @@ -51,6 +51,10 @@ exports[`renders demo correctly 1`] = `
日期区间最大范围
+
+
自定义周起始日
+ +
diff --git a/src/calendar/test/prop.spec.js b/src/calendar/test/prop.spec.js index 726e7dfef..3a8a8e183 100644 --- a/src/calendar/test/prop.spec.js +++ b/src/calendar/test/prop.spec.js @@ -191,3 +191,24 @@ test('month-show event', async () => { expect(wrapper.emitted('month-show')).toBeTruthy(); }); + +test('first day of week', async () => { + const wrapper = mount(Calendar, { + propsData: { + poppable: false, + defaultDate: new Date(2020, 7, 1), + maxDate: new Date(2020, 7, 30), + firstDayOfWeek: 2, + }, + }); + + await later(); + + expect(wrapper.find('.van-calendar__weekdays').text()[0]).toEqual('二'); + + const day = wrapper.find( + '.van-calendar__month:first-of-type .van-calendar__day' + ); + expect(day.text()).toEqual('1'); + expect(day.attributes('style')).toContain(`margin-left: ${100 / 7}%`); +}); diff --git a/src/cell/README.md b/src/cell/README.md index 63e9248b5..e475fc1f0 100644 --- a/src/cell/README.md +++ b/src/cell/README.md @@ -95,7 +95,7 @@ Vue.use(CellGroup); ``` diff --git a/src/cell/README.zh-CN.md b/src/cell/README.zh-CN.md index d02da1172..f13bd478b 100644 --- a/src/cell/README.zh-CN.md +++ b/src/cell/README.zh-CN.md @@ -96,7 +96,7 @@ Vue.use(CellGroup); ``` diff --git a/src/cell/demo/index.vue b/src/cell/demo/index.vue index f7b47398a..1769799fb 100644 --- a/src/cell/demo/index.vue +++ b/src/cell/demo/index.vue @@ -60,7 +60,10 @@ diff --git a/src/cell/test/__snapshots__/demo.spec.js.snap b/src/cell/test/__snapshots__/demo.spec.js.snap index 20a039dac..b66a4b780 100644 --- a/src/cell/test/__snapshots__/demo.spec.js.snap +++ b/src/cell/test/__snapshots__/demo.spec.js.snap @@ -94,7 +94,7 @@ exports[`renders demo correctly 1`] = `
-
单元格
+
单元格
diff --git a/src/datetime-picker/DatePicker.js b/src/datetime-picker/DatePicker.js index 9f2d20a54..6ee4ac6cd 100644 --- a/src/datetime-picker/DatePicker.js +++ b/src/datetime-picker/DatePicker.js @@ -83,20 +83,28 @@ export default createComponent({ }, ]; - if (this.type === 'date') { - result = result.slice(0, 3); + switch (this.type) { + case 'date': + result = result.slice(0, 3); + break; + case 'year-month': + result = result.slice(0, 2); + break; + case 'month-day': + result = result.slice(1, 3); + break; + case 'datehour': + result = result.slice(0, 4); + break; } - if (this.type === 'year-month') { - result = result.slice(0, 2); - } - - if (this.type === 'month-day') { - result = result.slice(1, 3); - } - - if (this.type === 'datehour') { - result = result.slice(0, 4); + if (this.columnsOrder) { + const columnsOrder = this.columnsOrder.concat( + result.map((column) => column.type) + ); + result.sort( + (a, b) => columnsOrder.indexOf(a.type) - columnsOrder.indexOf(b.type) + ); } return result; @@ -155,7 +163,13 @@ export default createComponent({ updateInnerValue() { const { type } = this; const indexes = this.getPicker().getIndexes(); - const getValue = (index) => { + const getValue = (type) => { + let index = 0; + this.originColumns.forEach((column, columnIndex) => { + if (type === column.type) { + index = columnIndex; + } + }); const { values } = this.originColumns[index]; return getTrueValue(values[indexes[index]]); }; @@ -163,15 +177,14 @@ export default createComponent({ let year; let month; let day; - if (type === 'month-day') { year = this.innerValue.getFullYear(); - month = getValue(0); - day = getValue(1); + month = getValue('month'); + day = getValue('day'); } else { - year = getValue(0); - month = getValue(1); - day = type === 'year-month' ? 1 : getValue(2); + year = getValue('year'); + month = getValue('month'); + day = type === 'year-month' ? 1 : getValue('day'); } const maxDay = getMonthEndDay(year, month); @@ -181,12 +194,12 @@ export default createComponent({ let minute = 0; if (type === 'datehour') { - hour = getValue(3); + hour = getValue('hour'); } if (type === 'datetime') { - hour = getValue(3); - minute = getValue(4); + hour = getValue('hour'); + minute = getValue('minute'); } const value = new Date(year, month - 1, day, hour, minute); @@ -208,32 +221,23 @@ export default createComponent({ const value = this.innerValue; const { formatter } = this; - let values = [ - formatter('year', `${value.getFullYear()}`), - formatter('month', padZero(value.getMonth() + 1)), - formatter('day', padZero(value.getDate())), - ]; - - if (this.type === 'datetime') { - values.push( - formatter('hour', padZero(value.getHours())), - formatter('minute', padZero(value.getMinutes())) - ); - } - - if (this.type === 'datehour') { - values.push( - formatter('hour', padZero(value.getHours())) - ); - } - - if (this.type === 'year-month') { - values = values.slice(0, 2); - } - - if (this.type === 'month-day') { - values = values.slice(1, 3); - } + const values = this.originColumns.map((column) => { + switch (column.type) { + case 'year': + return formatter('year', `${value.getFullYear()}`); + case 'month': + return formatter('month', padZero(value.getMonth() + 1)); + case 'day': + return formatter('day', padZero(value.getDate())); + case 'hour': + return formatter('hour', padZero(value.getHours())); + case 'minute': + return formatter('minute', padZero(value.getMinutes())); + default: + // no default + return null; + } + }); this.$nextTick(() => { this.getPicker().setValues(values); diff --git a/src/datetime-picker/README.md b/src/datetime-picker/README.md index bd5539af8..bd27f1e51 100644 --- a/src/datetime-picker/README.md +++ b/src/datetime-picker/README.md @@ -208,6 +208,42 @@ export default { }; ``` +### Columns Order + +```html + +``` + +```js +export default { + data() { + return { + currentDate: new Date(), + }; + }, + methods: { + formatter(type, val) { + if (type === 'year') { + return val + ' Year'; + } + if (type === 'month') { + return val + ' Month'; + } + if (type === 'day') { + return val + ' Day'; + } + return val; + }, + }, +}; +``` + ## API ### Props @@ -222,6 +258,7 @@ export default { | loading | Whether to show loading prompt | _boolean_ | `false` | | filter | Option filter | _(type, vals) => vals_ | - | | formatter | Option text formatter | _(type, val) => val_ | - | +| columns-order `v2.9.2` | Array for ordering columns, where item can be set to
`year`, `month`, `day`, `hour` and `minute` | _string[]_ | - | | item-height `v2.8.6` | Option height, supports `px` ans `rem` unit, default `px` | _number \| string_ | `44` | | visible-item-count | Count of visible columns | _number \| string_ | `5` | | swipe-duration `v2.2.13` | Duration of the momentum animation,unit `ms` | _number \| string_ | `1000` | diff --git a/src/datetime-picker/README.zh-CN.md b/src/datetime-picker/README.zh-CN.md index c772a4264..22f7d54f8 100644 --- a/src/datetime-picker/README.zh-CN.md +++ b/src/datetime-picker/README.zh-CN.md @@ -217,6 +217,42 @@ export default { }; ``` +### 自定义列排序 + +```html + +``` + +```js +export default { + data() { + return { + currentDate: new Date(), + }; + }, + methods: { + formatter(type, val) { + if (type === 'year') { + return val + '年'; + } + if (type === 'month') { + return val + '月'; + } + if (type === 'day') { + return val + '日'; + } + return val; + }, + }, +}; +``` + ## API ### Props @@ -231,6 +267,7 @@ export default { | loading | 是否显示加载状态 | _boolean_ | `false` | | filter | 选项过滤函数 | _(type, vals) => vals_ | - | | formatter | 选项格式化函数 | _(type, val) => val_ | - | +| columns-order `v2.9.2` | 自定义列排序数组, 子项可选值为
`year`、`month`、`day`、`hour`、`minute` | _string[]_ | - | | item-height `v2.8.6` | 选项高度,支持 `px` 和 `rem` 单位,默认 `px` | _number \| string_ | `44` | | visible-item-count | 可见的选项个数 | _number \| string_ | `5` | | swipe-duration `v2.2.13` | 快速滑动时惯性滚动的时长,单位`ms` | _number \| string_ | `1000` | diff --git a/src/datetime-picker/demo/index.vue b/src/datetime-picker/demo/index.vue index 316474ed0..690cf5644 100644 --- a/src/datetime-picker/demo/index.vue +++ b/src/datetime-picker/demo/index.vue @@ -21,7 +21,7 @@ />
- + - + + + + + @@ -87,9 +99,10 @@ export default { monthDayType: '选择月日', yearMonthType: '选择年月', optionFilter: '选项过滤器', + sortColumns: '自定义列排序', }, 'en-US': { - day: 'Day', + day: ' Day', year: ' Year', month: ' Month', timeType: 'Choose Time', @@ -99,6 +112,7 @@ export default { monthDayType: 'Choose Month-Day', yearMonthType: 'Choose Year-Month', optionFilter: 'Option Filter', + sortColumns: 'Columns Order', }, }, @@ -114,6 +128,7 @@ export default { monthDay: new Date(2020, 0, 1), yearMonth: new Date(2020, 0, 1), optionFilter: '12:00', + sortColumnsDate: new Date(2020, 0, 1), }, }; }, diff --git a/src/datetime-picker/shared.js b/src/datetime-picker/shared.js index c478b8c69..45ad4a273 100644 --- a/src/datetime-picker/shared.js +++ b/src/datetime-picker/shared.js @@ -15,6 +15,7 @@ export const sharedProps = { type: Function, default: (type, value) => value, }, + columnsOrder: Array, }; export const TimePickerMixin = { diff --git a/src/datetime-picker/test/__snapshots__/demo.spec.js.snap b/src/datetime-picker/test/__snapshots__/demo.spec.js.snap index f5d53bde5..30a574b09 100644 --- a/src/datetime-picker/test/__snapshots__/demo.spec.js.snap +++ b/src/datetime-picker/test/__snapshots__/demo.spec.js.snap @@ -1442,5 +1442,177 @@ exports[`renders demo correctly 1`] = ` +
+
+
+
自定义列排序
+
+ +
+
+
    +
  • +
    01月
    +
  • +
  • +
    02月
    +
  • +
  • +
    03月
    +
  • +
  • +
    04月
    +
  • +
  • +
    05月
    +
  • +
  • +
    06月
    +
  • +
  • +
    07月
    +
  • +
  • +
    08月
    +
  • +
  • +
    09月
    +
  • +
  • +
    10月
    +
  • +
  • +
    11月
    +
  • +
  • +
    12月
    +
  • +
+
+
+
    +
  • +
    01日
    +
  • +
  • +
    02日
    +
  • +
  • +
    03日
    +
  • +
  • +
    04日
    +
  • +
  • +
    05日
    +
  • +
  • +
    06日
    +
  • +
  • +
    07日
    +
  • +
  • +
    08日
    +
  • +
  • +
    09日
    +
  • +
  • +
    10日
    +
  • +
  • +
    11日
    +
  • +
  • +
    12日
    +
  • +
  • +
    13日
    +
  • +
  • +
    14日
    +
  • +
  • +
    15日
    +
  • +
  • +
    16日
    +
  • +
  • +
    17日
    +
  • +
  • +
    18日
    +
  • +
  • +
    19日
    +
  • +
  • +
    20日
    +
  • +
  • +
    21日
    +
  • +
  • +
    22日
    +
  • +
  • +
    23日
    +
  • +
  • +
    24日
    +
  • +
  • +
    25日
    +
  • +
  • +
    26日
    +
  • +
  • +
    27日
    +
  • +
  • +
    28日
    +
  • +
  • +
    29日
    +
  • +
  • +
    30日
    +
  • +
  • +
    31日
    +
  • +
+
+
+
    +
  • +
    2020年
    +
  • +
  • +
    2021年
    +
  • +
  • +
    2022年
    +
  • +
  • +
    2023年
    +
  • +
  • +
    2024年
    +
  • +
  • +
    2025年
    +
  • +
+
+
+
+
+ +
+
`; diff --git a/src/sku/index.less b/src/sku/index.less index f663c091d..4d32974db 100644 --- a/src/sku/index.less +++ b/src/sku/index.less @@ -318,6 +318,9 @@ .van-cell__title { max-width: @field-label-width; margin-right: @field-label-margin-right; + color: @field-label-color; + text-align: left; + word-wrap: break-word; } .van-cell__value { diff --git a/src/slider/index.less b/src/slider/index.less index 6919ffe0c..28d51adc8 100644 --- a/src/slider/index.less +++ b/src/slider/index.less @@ -24,7 +24,7 @@ height: 100%; background-color: @slider-active-background-color; border-radius: inherit; - transition: width @animation-duration-fast; + transition: width @animation-duration-fast, height @animation-duration-fast; } &__button { diff --git a/src/tabs/index.js b/src/tabs/index.js index 3123d4b04..9765c0e2f 100644 --- a/src/tabs/index.js +++ b/src/tabs/index.js @@ -267,7 +267,7 @@ export default createComponent({ }, // emit event when clicked - onClick(index) { + onClick(item, index) { const { title, disabled, computedName } = this.children[index]; if (disabled) { this.$emit('disabled', computedName, title); @@ -275,6 +275,7 @@ export default createComponent({ this.setCurrentIndex(index); this.scrollToCurrentContent(); this.$emit('click', computedName, title); + route(item.$router, item); } }, @@ -360,8 +361,7 @@ export default createComponent({ default: () => item.slots('title'), }} onClick={() => { - this.onClick(index); - route(item.$router, item); + this.onClick(item, index); }} /> ));