mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
Merge branch 'dev' into next
This commit is contained in:
commit
791d9e2315
@ -10,6 +10,32 @@ 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.10.10](https://github.com/youzan/vant/compare/v2.10.9...v2.10.10)
|
||||
|
||||
`2020-10-18`
|
||||
|
||||
**Feature**
|
||||
|
||||
- Icons: add minus icon [40e26f](https://github.com/youzan/vant/commit/40e26f97d1144d0dd0810075af8616676459ced3)
|
||||
- IndexBar: add change event [#7296](https://github.com/youzan/vant/issues/7296)
|
||||
|
||||
**Improvement**
|
||||
|
||||
- add info prop deprecation warning [#7352](https://github.com/youzan/vant/issues/7352) [#7347](https://github.com/youzan/vant/issues/7347)
|
||||
- SwitchCell: add deprecation warning [#7350](https://github.com/youzan/vant/issues/7350)
|
||||
- Toast: add mask option deprecation warning [#7342](https://github.com/youzan/vant/issues/7342)
|
||||
- TreeSelect: add deprecation warning of navclick/itemclick [#7351](https://github.com/youzan/vant/issues/7351)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Calendar: does not show current month with larger screen sizes [#7355](https://github.com/youzan/vant/issues/7355)
|
||||
- Tabs: incorrect animation when content is empty [#7354](https://github.com/youzan/vant/issues/7354)
|
||||
- Field: incorrect label length when label-align is right [#7349](https://github.com/youzan/vant/issues/7349)
|
||||
- GridItem: failed to break word [#7292](https://github.com/youzan/vant/issues/7292)
|
||||
- Icon: incomplete after-sale/cash-back-record [#7328](https://github.com/youzan/vant/issues/7328)
|
||||
- Picker: incorrect loading z-index [14cd28](https://github.com/youzan/vant/commit/14cd2863cc75d4f7328ddcf19808b9f6eec38fa4)
|
||||
- Row: should enable flex wrap [#7332](https://github.com/youzan/vant/issues/7332)
|
||||
|
||||
### [v2.10.9](https://github.com/youzan/vant/compare/v2.10.8...v2.10.9)
|
||||
|
||||
`2020-10-01`
|
||||
|
@ -10,6 +10,32 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
|
||||
- 次版本号:每隔一至二个月发布,包含新特性和较大的功能更新,向下兼容。
|
||||
- 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。
|
||||
|
||||
### [v2.10.10](https://github.com/youzan/vant/compare/v2.10.9...v2.10.10)
|
||||
|
||||
`2020-10-18`
|
||||
|
||||
**Feature**
|
||||
|
||||
- Icons: 新增 minus 减号图标 [40e26f](https://github.com/youzan/vant/commit/40e26f97d1144d0dd0810075af8616676459ced3)
|
||||
- IndexBar: 新增 change 事件 [#7296](https://github.com/youzan/vant/issues/7296)
|
||||
|
||||
**Improvement**
|
||||
|
||||
- 增加 info 属性的废弃提示 [#7352](https://github.com/youzan/vant/issues/7352) [#7347](https://github.com/youzan/vant/issues/7347)
|
||||
- SwitchCell: 增加组件废弃提示 [#7350](https://github.com/youzan/vant/issues/7350)
|
||||
- Toast: 新增 mask 选项的废弃提示 [#7342](https://github.com/youzan/vant/issues/7342)
|
||||
- TreeSelect: 增加 navclick 和 itemclick 事件的废弃提示 [#7351](https://github.com/youzan/vant/issues/7351)
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Calendar: 修复在大屏幕上日期展示不全的问题 [#7355](https://github.com/youzan/vant/issues/7355)
|
||||
- Tabs: 修复部分标签页内容为空且开启 animated 时展示错误的问题 [#7354](https://github.com/youzan/vant/issues/7354)
|
||||
- Field: 修复 label-align 为 right 时 label 只能展示五个字的问题 [#7349](https://github.com/youzan/vant/issues/7349)
|
||||
- GridItem: 修复文字未正确换行的问题 [#7292](https://github.com/youzan/vant/issues/7292)
|
||||
- Icon: 修复 after-sale 和 cash-back-record 图标在真机上不完整的问题 [#7328](https://github.com/youzan/vant/issues/7328)
|
||||
- Picker: 修复加载图标的 z-index 错误的问题 [14cd28](https://github.com/youzan/vant/commit/14cd2863cc75d4f7328ddcf19808b9f6eec38fa4)
|
||||
- Row: 修复开启 flex 模式时未能正确换行的问题 [#7332](https://github.com/youzan/vant/issues/7332)
|
||||
|
||||
### [v2.10.9](https://github.com/youzan/vant/compare/v2.10.8...v2.10.9)
|
||||
|
||||
`2020-10-01`
|
||||
|
@ -57,7 +57,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.x",
|
||||
"@vant/icons": "1.3.1",
|
||||
"@vant/icons": "1.3.2",
|
||||
"@vant/use": "^0.0.9",
|
||||
"vue-lazyload": "1.2.3"
|
||||
},
|
||||
|
@ -1,5 +1,10 @@
|
||||
## Changelog
|
||||
|
||||
## 1.3.2
|
||||
|
||||
- fix incomplete after-sale icon
|
||||
- fix incomplete cash-back-record icon
|
||||
|
||||
## 1.3.1
|
||||
|
||||
- add minus icon
|
||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/icons",
|
||||
"version": "1.3.1",
|
||||
"version": "1.3.2",
|
||||
"description": "vant icons",
|
||||
"main": "./src/config.js",
|
||||
"files": [
|
||||
|
File diff suppressed because one or more lines are too long
@ -5,9 +5,9 @@
|
||||
font-family: 'vant-icon';
|
||||
font-style: normal;
|
||||
font-display: auto;
|
||||
src: url('https://img.yzcdn.cn/vant/vant-icon-09002a.woff2') format('woff2'),
|
||||
url('https://img.yzcdn.cn/vant/vant-icon-09002a.woff') format('woff'),
|
||||
url('https://img.yzcdn.cn/vant/vant-icon-09002a.ttf') format('truetype');
|
||||
src: url('https://img.yzcdn.cn/vant/vant-icon-96970a.woff2') format('woff2'),
|
||||
url('https://img.yzcdn.cn/vant/vant-icon-96970a.woff') format('woff'),
|
||||
url('https://img.yzcdn.cn/vant/vant-icon-96970a.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.van-icon {
|
||||
|
@ -269,7 +269,7 @@ Following props are supported when the type is range
|
||||
| --- | --- | --- | --- |
|
||||
| max-range `v2.4.3` | Number of selectable days | _number \| string_ | Unlimitied |
|
||||
| range-prompt `v2.4.3` | Error message when exceeded max range | _string_ | `Choose no more than xx days` |
|
||||
| allow-same-day `v2.5.6` | Whether the start and end time of the range is allowed on the same day | _boolean_ | `fasle` |
|
||||
| allow-same-day `v2.5.6` | Whether the start and end time of the range is allowed on the same day | _boolean_ | `false` |
|
||||
|
||||
### Multiple Props
|
||||
|
||||
|
@ -271,7 +271,7 @@ export default {
|
||||
| --- | --- | --- | --- |
|
||||
| max-range `v2.4.3` | 日期区间最多可选天数 | _number \| string_ | 无限制 |
|
||||
| range-prompt `v2.4.3` | 范围选择超过最多可选天数时的提示文案 | _string_ | `选择天数不能超过 xx 天` |
|
||||
| allow-same-day `v2.5.6` | 是否允许日期范围的起止时间为同一天 | _boolean_ | `fasle` |
|
||||
| allow-same-day `v2.5.6` | 是否允许日期范围的起止时间为同一天 | _boolean_ | `false` |
|
||||
|
||||
### Multiple Props
|
||||
|
||||
|
@ -236,29 +236,34 @@ export default createComponent({
|
||||
|
||||
let height = 0;
|
||||
let currentMonth;
|
||||
let visibleIndex;
|
||||
const visibleRange = [-1, -1];
|
||||
|
||||
for (let i = 0; i < months.value.length; i++) {
|
||||
const month = monthRefs.value[i];
|
||||
const visible = height <= bottom && height + heights[i] >= top;
|
||||
|
||||
if (visible && !currentMonth) {
|
||||
visibleIndex = i;
|
||||
currentMonth = month;
|
||||
}
|
||||
if (visible) {
|
||||
visibleRange[1] = i;
|
||||
|
||||
if (!month.visible && visible) {
|
||||
emit('month-show', {
|
||||
date: month.getDate(),
|
||||
title: month.getTitle(),
|
||||
});
|
||||
if (!currentMonth) {
|
||||
currentMonth = month;
|
||||
visibleRange[0] = i;
|
||||
}
|
||||
|
||||
if (!month.visible) {
|
||||
emit('month-show', {
|
||||
date: month.date,
|
||||
title: month.title,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
height += heights[i];
|
||||
}
|
||||
|
||||
months.value.forEach((month, index) => {
|
||||
const visible = index >= visibleIndex - 1 && index <= visibleIndex + 1;
|
||||
const visible =
|
||||
index >= visibleRange[0] - 1 && index <= visibleRange[1] + 1;
|
||||
monthRefs.value[index].setVisible(visible);
|
||||
});
|
||||
|
||||
|
@ -139,7 +139,40 @@ exports[`renders demo correctly 1`] = `
|
||||
</div>
|
||||
<div class="van-calendar__month" style="padding-bottom: 0px;">
|
||||
<div class="van-calendar__month-title">2012年3月</div>
|
||||
<div></div>
|
||||
<div role="grid" class="van-calendar__days">
|
||||
<div class="van-calendar__month-mark">3</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day" style="margin-left: 57.142857142857146%;">1</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">2</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">3</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">4</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">5</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">6</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">7</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">8</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">9</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">10</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">11</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">12</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">13</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">14</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">15</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">16</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">17</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">18</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">19</div>
|
||||
<div role="gridcell" tabindex="-1" class="van-calendar__day">20</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">21</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">22</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">23</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">24</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">25</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">26</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">27</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">28</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">29</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">30</div>
|
||||
<div role="gridcell" class="van-calendar__day van-calendar__day--disabled">31</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-calendar__footer"></div>
|
||||
|
@ -85,15 +85,15 @@ app.use(CellGroup);
|
||||
### Use Slots
|
||||
|
||||
```html
|
||||
<van-cell value="内容" is-link>
|
||||
<van-cell value="Content" is-link>
|
||||
<!-- Use the title slot to customize the title -->
|
||||
<template #title>
|
||||
<span class="custom-title">单元格</span>
|
||||
<van-tag type="danger">标签</van-tag>
|
||||
<span class="custom-title">Title</span>
|
||||
<van-tag type="danger">Tag</van-tag>
|
||||
</template>
|
||||
</van-cell>
|
||||
|
||||
<van-cell title="单元格" icon="shop-o">
|
||||
<van-cell title="Title" icon="shop-o">
|
||||
<!-- Use the right-icon slot to customize the right icon -->
|
||||
<template #right-icon>
|
||||
<van-icon name="search" class="search-icon" />
|
||||
|
@ -123,28 +123,6 @@ test('lazy render collapse content', async () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('warn when value type is incorrect', () => {
|
||||
const originConsoleError = console.error;
|
||||
const error = jest.fn();
|
||||
console.error = error;
|
||||
|
||||
mount({
|
||||
template: `
|
||||
<van-collapse v-model="active">
|
||||
<van-collapse-item title="a" name="first"></van-collapse-item>
|
||||
</van-collapse>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
expect(error).toHaveBeenCalledTimes(1);
|
||||
console.error = originConsoleError;
|
||||
});
|
||||
|
||||
test('toggle method', (done) => {
|
||||
mount({
|
||||
template: `
|
||||
|
@ -15,7 +15,6 @@
|
||||
}
|
||||
|
||||
&--right {
|
||||
padding-right: @padding-md;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ export default {
|
||||
| lazy-render | 是否开启延迟渲染(首次切换到标签时才触发内容渲染) | _boolean_ | `true` |
|
||||
| scrollspy `v2.3.0` | 是否开启滚动导航 | _boolean_ | `false` |
|
||||
| offset-top `v2.8.7` | 粘性定位布局下与顶部的最小距离,支持 `px` `vw` `rem` 单位,默认 `px` | _number \| string_ | `0` |
|
||||
| swipe-threshold | 滚动阈值,标签数量超过阈值时开始横向滚动 | _number \| string_ | `5` |
|
||||
| swipe-threshold | 滚动阈值,标签数量超过阈值且总宽度超过标签栏宽度时开始横向滚动 | _number \| string_ | `5` |
|
||||
| title-active-color | 标题选中态颜色 | _string_ | - |
|
||||
| title-inactive-color | 标题默认态颜色 | _string_ | - |
|
||||
| before-change `v2.9.3` | 切换标签前的回调函数,返回 `false` 可阻止切换,支持返回 Promise | _(name) => boolean \| Promise_ | - |
|
||||
|
@ -60,11 +60,12 @@ export default createComponent({
|
||||
);
|
||||
|
||||
return () => {
|
||||
if (!slots.default) {
|
||||
const { animated, swipeable, scrollspy, lazyRender } = parent.props;
|
||||
|
||||
if (!slots.default && !animated) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { animated, swipeable, scrollspy, lazyRender } = parent.props;
|
||||
const active = isActive();
|
||||
const show = scrollspy || active;
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`badge prop 1`] = `
|
||||
<div class="van-tabs van-tabs--line">
|
||||
<div class="van-tabs__wrap">
|
||||
<div role="tablist" class="van-tabs__nav van-tabs__nav--line">
|
||||
<div role="tab" aria-selected="true" class="van-tab van-tab--active"><span class="van-tab__text-wrapper"><span class="van-tab__text van-tab__text--ellipsis"></span>
|
||||
<div class="van-info">10</div>
|
||||
</span></div>
|
||||
<div class="van-tabs__line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-tabs__content">
|
||||
<div role="tabpanel" class="van-tab__pane">Text</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`border props 1`] = `
|
||||
<div class="van-tabs van-tabs--line">
|
||||
<div class="van-tabs__wrap">
|
||||
|
@ -25,7 +25,7 @@ exports[`height prop 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`nav badge 1`] = `
|
||||
exports[`nav render badge 1`] = `
|
||||
<div class="van-tree-select" style="height: 300px;">
|
||||
<div class="van-sidebar van-tree-select__nav"><a class="van-sidebar-item van-sidebar-item--select van-tree-select__nav-item">
|
||||
<div class="van-sidebar-item__text">group1<div class="van-badge van-sidebar-item__badge">3</div>
|
||||
|
@ -27,7 +27,6 @@ const mockItems = [
|
||||
];
|
||||
|
||||
test('click-nav event', () => {
|
||||
const onNavClick = jest.fn();
|
||||
const onClickNav = jest.fn();
|
||||
|
||||
const wrapper = mount(TreeSelect, {
|
||||
@ -36,7 +35,6 @@ test('click-nav event', () => {
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
navclick: onNavClick,
|
||||
'click-nav': onClickNav,
|
||||
},
|
||||
},
|
||||
@ -45,12 +43,10 @@ test('click-nav event', () => {
|
||||
const navItems = wrapper.findAll('.van-tree-select__nav-item');
|
||||
navItems.at(1).trigger('click');
|
||||
|
||||
expect(onNavClick).toHaveBeenCalledWith(1);
|
||||
expect(onClickNav).toHaveBeenCalledWith(1);
|
||||
});
|
||||
|
||||
test('click-item event', () => {
|
||||
const onItemClick = jest.fn();
|
||||
const onClickItem = jest.fn();
|
||||
|
||||
const wrapper = mount(TreeSelect, {
|
||||
@ -59,7 +55,6 @@ test('click-item event', () => {
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
itemclick: onItemClick,
|
||||
'click-item': onClickItem,
|
||||
},
|
||||
},
|
||||
@ -67,7 +62,6 @@ test('click-item event', () => {
|
||||
|
||||
const items = wrapper.findAll('.van-tree-select__item');
|
||||
items.at(0).trigger('click');
|
||||
expect(onItemClick).toHaveBeenCalledWith(mockItem);
|
||||
expect(onClickItem).toHaveBeenCalledWith(mockItem);
|
||||
});
|
||||
|
||||
@ -151,7 +145,7 @@ test('height prop', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('nav badge', () => {
|
||||
test('nav render badge', () => {
|
||||
const wrapper = mount(TreeSelect, {
|
||||
propsData: {
|
||||
items: [
|
||||
|
@ -2204,10 +2204,10 @@
|
||||
eslint-plugin-import "^2.22.0"
|
||||
eslint-plugin-vue "^7.0.1"
|
||||
|
||||
"@vant/icons@1.3.1":
|
||||
version "1.3.1"
|
||||
resolved "https://registry.npmjs.org/@vant/icons/-/icons-1.3.1.tgz#07207fc1c8b5adfd40c22c3647fb535943b33c53"
|
||||
integrity sha512-zzFlR5RoPw2P/wFweyFVYUmKfH6o8ZLd2m+s/tdOm6OBJajAbDQyFK6RIjtFMMu+A27rhXbfUuWRhp7tW76yYw==
|
||||
"@vant/icons@1.3.2":
|
||||
version "1.3.2"
|
||||
resolved "https://registry.npmjs.org/@vant/icons/-/icons-1.3.2.tgz#f0930010e7aaa9b06b03636fe9b5bc6477ea224b"
|
||||
integrity sha512-uP0nUWw0pyMMGt3L9BO5fEacz/Cn7QIea0/gFoC/jPLv9ufvUxjPsV9HSyyUJsqMJ3qlYLAI/SxZDbmMZA814A==
|
||||
|
||||
"@vant/markdown-loader@^3.0.0-alpha.0":
|
||||
version "3.0.0-alpha.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user