From de8aa10f3d72970fb45bcdb81f8cb4b065f57386 Mon Sep 17 00:00:00 2001
From: rex-zsd
Date: Mon, 25 May 2020 14:32:58 +0800
Subject: [PATCH 001/119] docs(changelog): release 1.3.1
---
docs/markdown/changelog.md | 12 ++++++++++++
package.json | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/docs/markdown/changelog.md b/docs/markdown/changelog.md
index 80b9f0a3..d0b2b1b2 100644
--- a/docs/markdown/changelog.md
+++ b/docs/markdown/changelog.md
@@ -1,5 +1,17 @@
# 更新日志
+### [v1.3.1](https://github.com/youzan/vant-weapp/tree/v1.3.1)
+`2020-05-24`
+
+**Features**
+
+- Button: 新增 class-prefix 属性 [\#3159](https://github.com/youzan/vant-weapp/pull/3159)
+- Collapse: 新增 open、close 事件 [\#3176](https://github.com/youzan/vant-weapp/pull/3176)
+
+**Bug Fixes**
+
+- 修复控制台提示选择器错误的问题 [\#3137](https://github.com/youzan/vant-weapp/pull/3137)
+- 修复 GoodsActionButton 在某些情况下报错的问题 [\#3145](https://github.com/youzan/vant-weapp/pull/3145)
### [v1.3.0](https://github.com/youzan/vant-weapp/tree/v1.3.0)
`2020-05-08`
diff --git a/package.json b/package.json
index f3e753a2..1fb9283b 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
"release": "sh build/release.sh",
"release:site": "sh build/release-site.sh",
"build:lib": "yarn && npx gulp -f build/compiler.js --series buildEs buildLib",
- "build:changelog": "vant changelog --tag v1.1.0 ./docs/markdown/changelog.generated.md",
+ "build:changelog": "vant changelog --tag v1.3.0 ./docs/markdown/changelog.generated.md",
"upload:weapp": "node build/upload.js"
},
"files": [
From 3cf7ceebfb9e9f4388448ca0c3512ba63df53ea1 Mon Sep 17 00:00:00 2001
From: rex
Date: Mon, 25 May 2020 14:41:03 +0800
Subject: [PATCH 002/119] fix(tag): fix wrong css variable name (#3191)
fix #3185
---
packages/common/style/var.less | 2 +-
packages/tag/index.less | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/common/style/var.less b/packages/common/style/var.less
index 093dd9d4..88655283 100644
--- a/packages/common/style/var.less
+++ b/packages/common/style/var.less
@@ -506,7 +506,7 @@
@tag-text-color: @white;
@tag-border-radius: 0.2em;
@tag-round-border-radius: @border-radius-max;
-@tag-dander-color: @red;
+@tag-danger-color: @red;
@tag-primary-color: @blue;
@tag-success-color: @green;
@tag-warning-color: @orange;
diff --git a/packages/tag/index.less b/packages/tag/index.less
index fb4093a9..a26b2c68 100644
--- a/packages/tag/index.less
+++ b/packages/tag/index.less
@@ -24,10 +24,10 @@
}
&--danger {
- .theme(background-color, '@tag-dander-color');
+ .theme(background-color, '@tag-danger-color');
&.van-tag--plain {
- .theme(color, '@tag-dander-color');
+ .theme(color, '@tag-danger-color');
}
}
From 3a37327ec158743720f81d375e8efa3a0e8113b5 Mon Sep 17 00:00:00 2001
From: rex
Date: Mon, 25 May 2020 15:18:20 +0800
Subject: [PATCH 003/119] feat(grid): add new prop direction (#3192)
fix #3180
---
example/pages/grid/index.wxml | 8 +++++++-
packages/grid-item/index.less | 13 +++++++++++++
packages/grid-item/index.ts | 11 ++++++++++-
packages/grid-item/index.wxml | 2 +-
packages/grid/index.ts | 4 ++++
5 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/example/pages/grid/index.wxml b/example/pages/grid/index.wxml
index e6f6cbfa..56280724 100644
--- a/example/pages/grid/index.wxml
+++ b/example/pages/grid/index.wxml
@@ -30,6 +30,12 @@
+
+
+
+
+
+
@@ -37,7 +43,7 @@
-
+
diff --git a/packages/grid-item/index.less b/packages/grid-item/index.less
index c43fc105..d824ab8a 100644
--- a/packages/grid-item/index.less
+++ b/packages/grid-item/index.less
@@ -41,13 +41,26 @@
left: 0;
}
+ &--horizontal {
+ flex-direction: row;
+
+ .van-grid-item__icon + .van-grid-item__text {
+ margin-top: 0;
+ margin-left: @padding-xs;
+ }
+ }
+
&--clickable:active {
.theme(background-color, '@grid-item-content-active-color');
}
}
&__icon {
+ display: flex;
+ align-items: center;
+
.theme(font-size, '@grid-item-icon-size');
+ .theme(height, '@grid-item-icon-size');
}
&__text {
diff --git a/packages/grid-item/index.ts b/packages/grid-item/index.ts
index f20f9c4c..1678b601 100644
--- a/packages/grid-item/index.ts
+++ b/packages/grid-item/index.ts
@@ -36,7 +36,15 @@ VantComponent({
}
const { data, children } = this.parent;
- const { columnNum, border, square, gutter, clickable, center } = data;
+ const {
+ columnNum,
+ border,
+ square,
+ gutter,
+ clickable,
+ center,
+ direction,
+ } = data;
const width = `${100 / columnNum}%`;
const styleWrapper = [];
@@ -76,6 +84,7 @@ VantComponent({
square,
gutter,
clickable,
+ direction,
});
},
diff --git a/packages/grid-item/index.wxml b/packages/grid-item/index.wxml
index 061f43c3..57a96281 100644
--- a/packages/grid-item/index.wxml
+++ b/packages/grid-item/index.wxml
@@ -2,7 +2,7 @@
diff --git a/packages/grid/index.ts b/packages/grid/index.ts
index 4332b3fc..fdc1b32b 100644
--- a/packages/grid/index.ts
+++ b/packages/grid/index.ts
@@ -37,6 +37,10 @@ VantComponent({
value: true,
observer: 'updateChildren',
},
+ direction: {
+ type: String,
+ observer: 'updateChildren',
+ },
},
data: {
From 1dc1960694d5c4768d7f647cdeab8bdc5bab06b8 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 27 May 2020 15:24:13 +0800
Subject: [PATCH 004/119] feat(button): add new prop form-type (#3208)
fix #3204
---
packages/button/README.md | 1 +
packages/button/index.ts | 3 ++-
packages/button/index.wxml | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/packages/button/README.md b/packages/button/README.md
index c5c03135..8935c8e0 100644
--- a/packages/button/README.md
+++ b/packages/button/README.md
@@ -142,6 +142,7 @@
| send-message-img | sendMessageImg | _string_ | 截图 | - |
| show-message-card | 显示会话内消息卡片 | _string_ | `false` | - |
| dataset | 按钮 dataset,open-type 为 `share` 时,可在 onShareAppMessage 事件的 `event.target.dataset.detail` 中看到传入的值 | _any_ | - | - |
+| form-type | 用于 form 组件,可选值为`submit` `reset`,点击分别会触发 form 组件的 submit/reset 事件 | _string_ | - | - |
### Events
diff --git a/packages/button/index.ts b/packages/button/index.ts
index 840d0f5b..37941126 100644
--- a/packages/button/index.ts
+++ b/packages/button/index.ts
@@ -3,7 +3,7 @@ import { button } from '../mixins/button';
import { openType } from '../mixins/open-type';
VantComponent({
- mixins: [button, openType],
+ mixins: [button, openType, 'wx://form-field-button'],
classes: ['hover-class', 'loading-class'],
@@ -12,6 +12,7 @@ VantComponent({
},
props: {
+ formType: String,
icon: String,
classPrefix: {
type: String,
diff --git a/packages/button/index.wxml b/packages/button/index.wxml
index 30abac96..ab393e8f 100644
--- a/packages/button/index.wxml
+++ b/packages/button/index.wxml
@@ -6,6 +6,7 @@
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
hover-class="van-button--active hover-class"
lang="{{ lang }}"
+ form-type="{{ formType }}"
style="{{ baseStyle }} {{ customStyle }}"
open-type="{{ disabled ? '' : openType }}"
business-id="{{ businessId }}"
From 662fe0a8ef22b5a9e8f8c873b961b68403e27c50 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 27 May 2020 15:33:18 +0800
Subject: [PATCH 005/119] docs(tag): add prop closable doc (#3209)
fix #3200
---
packages/tag/README.md | 51 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/packages/tag/README.md b/packages/tag/README.md
index 72a9dbf7..758e5817 100644
--- a/packages/tag/README.md
+++ b/packages/tag/README.md
@@ -78,6 +78,50 @@
标签
```
+### 可关闭标签
+
+添加`closeable`属性表示标签是可关闭的,关闭标签时会触发`close`事件,在`close`事件中可以执行隐藏标签的逻辑
+
+```html
+
+ 标签
+
+
+ 标签
+
+```
+
+```js
+Page({
+ data: {
+ show: {
+ primary: true,
+ success: true,
+ },
+ },
+
+ onClose(event) {
+ this.setData({
+ [`show.${event.target.id}`]: false,
+ });
+ },
+});
+```
+
## API
### Props
@@ -91,6 +135,7 @@
| round | 是否为圆角样式 | _boolean_ | `false` | - |
| mark | 是否为标记样式 | _boolean_ | `false` | - |
| text-color | 文本颜色,优先级高于`color`属性 | _string_ | `white` | - |
+| closeable | 是否为可关闭标签 | _boolean_ | `false` |
### Slot
@@ -98,6 +143,12 @@
| ---- | ------------------- |
| - | 自定义 Tag 显示内容 |
+### Events
+
+| 事件名 | 说明 | 回调参数 |
+| ------ | -------------- | -------- |
+| close | 关闭标签时触发 | - |
+
### 外部样式类
| 类名 | 说明 |
From 6fee285b080938a613db4db82977b24642410f8f Mon Sep 17 00:00:00 2001
From: neverland
Date: Thu, 28 May 2020 11:26:15 +0800
Subject: [PATCH 006/119] build: add actions to sync to gitee (#3212)
---
.github/workflows/sync.yml | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 .github/workflows/sync.yml
diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml
new file mode 100644
index 00000000..30cbac7d
--- /dev/null
+++ b/.github/workflows/sync.yml
@@ -0,0 +1,30 @@
+name: Sync to Gitee
+
+on:
+ push:
+ branches: [dev]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Sync to Gitee
+ uses: wearerequired/git-mirror-action@master
+ env:
+ # 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
+ SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
+ with:
+ # 注意替换为你的 GitHub 源仓库地址
+ source-repo: 'git@github.com:youzan/vant-weapp.git'
+ # 注意替换为你的 Gitee 目标仓库地址
+ destination-repo: 'git@gitee.com:vant-contrib/vant-weapp.git'
+
+ - name: Build Gitee Pages
+ uses: yanglbme/gitee-pages-action@master
+ with:
+ # 注意替换为你的 Gitee 用户名
+ gitee-username: chenjiahan
+ # 注意在 Settings->Secrets 配置 GITEE_PASSWORD
+ gitee-password: ${{ secrets.GITEE_PASSWORD }}
+ # 注意替换为你的 Gitee 仓库
+ gitee-repo: vant-contrib/vant-weapp
From 5ccc355e3d90cd6b7c55d81995aeaff37d7d8388 Mon Sep 17 00:00:00 2001
From: f00bar <2937443168@qq.com>
Date: Sun, 31 May 2020 00:19:18 +0800
Subject: [PATCH 007/119] docs: typo fix in uploader (#3224)
---
packages/uploader/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/uploader/README.md b/packages/uploader/README.md
index d44f6312..d5026619 100644
--- a/packages/uploader/README.md
+++ b/packages/uploader/README.md
@@ -85,7 +85,7 @@ Page({
fileList: [
{
url: 'https://img.yzcdn.cn/vant/leaf.jpg',
- statue: 'uploading',
+ status: 'uploading',
message: '上传中',
},
{
From f40a5fbe97f3d9f9f51c1a8040104c6c65ab5009 Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 2 Jun 2020 21:40:34 +0800
Subject: [PATCH 008/119] fix(circle): fix type not work (#3228)
fix #3168
---
example/pages/circle/index.wxml | 2 +-
package.json | 2 +-
packages/circle/README.md | 2 +-
packages/circle/canvas.ts | 47 +++++++++++++++++++
packages/circle/index.ts | 81 ++++++++++++++++++++++-----------
packages/circle/index.wxml | 4 +-
yarn.lock | 8 ++--
7 files changed, 110 insertions(+), 36 deletions(-)
create mode 100644 packages/circle/canvas.ts
diff --git a/example/pages/circle/index.wxml b/example/pages/circle/index.wxml
index a1175caf..02ca4048 100644
--- a/example/pages/circle/index.wxml
+++ b/example/pages/circle/index.wxml
@@ -1,5 +1,5 @@
-
+
diff --git a/package.json b/package.json
index 1fb9283b..c10c9dec 100644
--- a/package.json
+++ b/package.json
@@ -68,7 +68,7 @@
"less": "^3.9.0",
"less-loader": "^5.0.0",
"lint-staged": "^10.0.0",
- "miniprogram-api-typings": "2.10.4",
+ "miniprogram-api-typings": "2.11.0",
"miniprogram-ci": "^1.0.27",
"postcss-loader": "^3.0.0",
"prettier": "^2.0.5",
diff --git a/packages/circle/README.md b/packages/circle/README.md
index ff7cf0c9..df3d171d 100644
--- a/packages/circle/README.md
+++ b/packages/circle/README.md
@@ -89,7 +89,7 @@ Page({
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| value | 目标进度 | _number_ | `0` | - |
-| type | 指定 canvas 类型,可选值为 `2d` `webgl` | _string_ | - | - |
+| type | 指定 canvas 类型,可选值为 `2d` | _string_ | - | - |
| size | 圆环直径,默认单位为 `px` | _number_ | `100` | - |
| color | 进度条颜色,传入对象格式可以定义渐变色 | _string \| object_ | `#1989fa` | - |
| layer-color | 轨道颜色 | _string_ | `#fff` | - |
diff --git a/packages/circle/canvas.ts b/packages/circle/canvas.ts
new file mode 100644
index 00000000..c82724a9
--- /dev/null
+++ b/packages/circle/canvas.ts
@@ -0,0 +1,47 @@
+type CanvasContext = WechatMiniprogram.CanvasContext;
+
+export function adaptor(
+ ctx: CanvasRenderingContext2D
+): CanvasContext & CanvasRenderingContext2D {
+ // @ts-ignore
+ return Object.assign(ctx, {
+ setStrokeStyle(val) {
+ ctx.strokeStyle = val;
+ },
+ setLineWidth(val) {
+ ctx.lineWidth = val;
+ },
+ setLineCap(val) {
+ ctx.lineCap = val;
+ },
+ setFillStyle(val) {
+ ctx.fillStyle = val;
+ },
+ setFontSize(val) {
+ ctx.font = String(val);
+ },
+ setGlobalAlpha(val) {
+ ctx.globalAlpha = val;
+ },
+ setLineJoin(val) {
+ ctx.lineJoin = val;
+ },
+ setTextAlign(val) {
+ ctx.textAlign = val;
+ },
+ setMiterLimit(val) {
+ ctx.miterLimit = val;
+ },
+ setShadow(offsetX, offsetY, blur, color) {
+ ctx.shadowOffsetX = offsetX;
+ ctx.shadowOffsetY = offsetY;
+ ctx.shadowBlur = blur;
+ ctx.shadowColor = color;
+ },
+ setTextBaseline(val) {
+ ctx.textBaseline = val;
+ },
+ createCircularGradient() {},
+ draw() {},
+ });
+}
diff --git a/packages/circle/index.ts b/packages/circle/index.ts
index 16718e2e..c8292308 100644
--- a/packages/circle/index.ts
+++ b/packages/circle/index.ts
@@ -1,6 +1,7 @@
import { VantComponent } from '../common/component';
import { isObj } from '../common/utils';
import { BLUE, WHITE } from '../common/color';
+import { adaptor } from './canvas';
function format(rate) {
return Math.min(Math.max(rate, 0), 100);
@@ -28,6 +29,9 @@ VantComponent({
size: {
type: Number,
value: 100,
+ observer() {
+ this.drawCircle(this.currentValue);
+ },
},
fill: String,
layerColor: {
@@ -59,38 +63,60 @@ VantComponent({
methods: {
getContext() {
- if (!this.ctx) {
- this.ctx = wx.createCanvasContext('van-circle', this);
+ const { type } = this.data;
+
+ if (type === '') {
+ const ctx = wx.createCanvasContext('van-circle', this);
+ return Promise.resolve(ctx);
}
- return this.ctx;
+
+ const dpr = wx.getSystemInfoSync().pixelRatio;
+
+ return new Promise((resolve) => {
+ wx.createSelectorQuery()
+ .in(this)
+ .select('#van-circle')
+ .fields({ node: true, size: true })
+ .exec((res) => {
+ const canvas = res[0].node;
+ const ctx = canvas.getContext(type);
+
+ canvas.width = res[0].width * dpr;
+ canvas.height = res[0].height * dpr;
+ ctx.scale(dpr, dpr);
+
+ resolve(adaptor(ctx));
+ });
+ });
},
setHoverColor() {
- const { color, size, type } = this.data;
- const context = type ? this.getContext(type) : this.getContext();
-
+ const { color, size } = this.data;
let hoverColor = color;
- if (isObj(color)) {
- const LinearColor = context.createLinearGradient(size, 0, 0, 0);
- Object.keys(color)
- .sort((a, b) => parseFloat(a) - parseFloat(b))
- .map((key) =>
- LinearColor.addColorStop(parseFloat(key) / 100, color[key])
- );
- hoverColor = LinearColor;
- }
+ this.getContext().then((context) => {
+ if (isObj(color)) {
+ const LinearColor = context.createLinearGradient(size, 0, 0, 0);
+ Object.keys(color)
+ .sort((a, b) => parseFloat(a) - parseFloat(b))
+ .map((key) =>
+ LinearColor.addColorStop(parseFloat(key) / 100, color[key])
+ );
+ hoverColor = LinearColor;
+ }
- this.setData({ hoverColor });
+ this.setData({ hoverColor });
+ });
},
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
- const { strokeWidth, lineCap, clockwise, size } = this.data;
+ const { strokeWidth, lineCap, clockwise, size, type } = this.data;
const position = size / 2;
const radius = position - strokeWidth / 2;
context.setStrokeStyle(strokeStyle);
context.setLineWidth(strokeWidth);
context.setLineCap(lineCap);
+
context.beginPath();
context.arc(position, position, radius, beginAngle, endAngle, !clockwise);
context.stroke();
@@ -118,17 +144,19 @@ VantComponent({
},
drawCircle(currentValue) {
- const { size, type } = this.data;
- const context = type ? this.getContext(type) : this.getContext();
- context.clearRect(0, 0, size, size);
- this.renderLayerCircle(context);
+ const { size } = this.data;
- const formatValue = format(currentValue);
- if (formatValue !== 0) {
- this.renderHoverCircle(context, formatValue);
- }
+ this.getContext().then((context) => {
+ context.clearRect(0, 0, size, size);
+ this.renderLayerCircle(context);
- context.draw();
+ const formatValue = format(currentValue);
+ if (formatValue !== 0) {
+ this.renderHoverCircle(context, formatValue);
+ }
+
+ context.draw();
+ });
},
reRender() {
@@ -171,7 +199,6 @@ VantComponent({
},
destroyed() {
- this.ctx = null;
this.clearInterval();
},
});
diff --git a/packages/circle/index.wxml b/packages/circle/index.wxml
index 607fc9d5..52bc59fc 100644
--- a/packages/circle/index.wxml
+++ b/packages/circle/index.wxml
@@ -1,9 +1,9 @@
-
+
{{ text }}
-
\ No newline at end of file
+
diff --git a/yarn.lock b/yarn.lock
index 9b06e3cc..5cb57cb5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7978,10 +7978,10 @@ minimist@^1.2.0, minimist@^1.2.5:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
-miniprogram-api-typings@2.10.4:
- version "2.10.4"
- resolved "https://registry.npmjs.org/miniprogram-api-typings/-/miniprogram-api-typings-2.10.4.tgz#13165d1e77084c3ec79ec93d8c74974f77425eb0"
- integrity sha512-IXWi6sJFd/EH1wNR8rtOx2+hJOwZk7jKFVIshQ0aAlRaKk0P4Jack4SItzUwNURgRykvrleGgErI/jH5hsiniw==
+miniprogram-api-typings@2.11.0:
+ version "2.11.0"
+ resolved "http://registry.npm.qima-inc.com/miniprogram-api-typings/download/miniprogram-api-typings-2.11.0.tgz#c0a91ca2fea80e344509399c580cbad504a8f905"
+ integrity sha1-wKkcov6oDjRFCTmcWAy61QSo+QU=
miniprogram-ci@^1.0.27:
version "1.0.29"
From 9a508de397c6f723e2a77a06c919071abce07fb1 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 3 Jun 2020 11:03:28 +0800
Subject: [PATCH 009/119] fix(button): compatible form-field-button in low sdk
version (#3229)
---
example/project.config.json | 19 +++++++++++++++++--
packages/button/index.ts | 8 +++++++-
packages/common/version.ts | 5 +++++
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/example/project.config.json b/example/project.config.json
index 78e2d532..885a07ff 100644
--- a/example/project.config.json
+++ b/example/project.config.json
@@ -7,13 +7,28 @@
"urlCheck": false,
"es6": true,
"postcss": true,
+ "preloadBackgroundData": false,
"minified": true,
"newFeature": true,
- "nodeModules": true
+ "coverView": true,
+ "nodeModules": true,
+ "autoAudits": false,
+ "showShadowRootInWxmlPanel": true,
+ "scopeDataCheck": false,
+ "checkInvalidKey": true,
+ "checkSiteMap": true,
+ "uploadWithSourceMap": true,
+ "babelSetting": {
+ "ignore": [],
+ "disablePlugins": [],
+ "outputPath": ""
+ },
+ "useCompilerModule": false,
+ "userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"cloudfunctionRoot": "functions/",
- "libVersion": "2.9.3",
+ "libVersion": "2.3.0",
"appid": "wx1c01b35002d3ba14",
"projectname": "vant-weapp",
"debugOptions": {
diff --git a/packages/button/index.ts b/packages/button/index.ts
index 37941126..7880e621 100644
--- a/packages/button/index.ts
+++ b/packages/button/index.ts
@@ -1,9 +1,15 @@
import { VantComponent } from '../common/component';
import { button } from '../mixins/button';
import { openType } from '../mixins/open-type';
+import { canIUseFormFieldButton } from '../common/version';
+
+const mixins = [button, openType];
+if (canIUseFormFieldButton()) {
+ mixins.push('wx://form-field-button');
+}
VantComponent({
- mixins: [button, openType, 'wx://form-field-button'],
+ mixins,
classes: ['hover-class', 'loading-class'],
diff --git a/packages/common/version.ts b/packages/common/version.ts
index 593f9f5c..ca3eba1b 100644
--- a/packages/common/version.ts
+++ b/packages/common/version.ts
@@ -31,3 +31,8 @@ export function canIUseModel() {
const system = getSystemInfoSync();
return compareVersion(system.SDKVersion, '2.9.3') >= 0;
}
+
+export function canIUseFormFieldButton() {
+ const system = getSystemInfoSync();
+ return compareVersion(system.SDKVersion, '2.10.3') >= 0;
+}
From 02bf7e857bc12fa7e79f354f056a8bb40457caa4 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 3 Jun 2020 11:08:34 +0800
Subject: [PATCH 010/119] fix(uploader): avoid emit click-preview event in
delete event (#3230)
fix #3216
---
packages/uploader/index.wxml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/uploader/index.wxml b/packages/uploader/index.wxml
index 9abcf47b..09f76563 100644
--- a/packages/uploader/index.wxml
+++ b/packages/uploader/index.wxml
@@ -42,7 +42,7 @@
name="clear"
class="van-uploader__preview-delete"
data-index="{{ index }}"
- bind:tap="deleteItem"
+ catch:tap="deleteItem"
/>
From d1cc1276ad8d62ebb7e75b1f89b672da8acd15f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=82=E9=A3=8E?=
Date: Wed, 3 Jun 2020 11:30:33 +0800
Subject: [PATCH 011/119] =?UTF-8?q?fix(calendar):=20=E5=9C=A8=E5=A4=9A?=
=?UTF-8?q?=E9=80=89=E6=97=A5=E6=9C=9F=E7=8A=B6=E6=80=81=E4=B8=8B,?=
=?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AE=8C=E5=90=8E=E7=82=B9=E7=A1=AE=E5=AE=9A?=
=?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8A=A5=E9=94=99=20(#3195)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/calendar/index.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/calendar/index.ts b/packages/calendar/index.ts
index 9386f2f8..cecf91b8 100644
--- a/packages/calendar/index.ts
+++ b/packages/calendar/index.ts
@@ -316,7 +316,7 @@ VantComponent({
},
onConfirm() {
- if (this.data.type === 'range' && !this.checkRange()) {
+ if (this.data.type === 'range' && !this.checkRange(this.data.currentDate)) {
return;
}
wx.nextTick(() => {
From 29f1628c0077c1646248efba466cb6ccae192ca9 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 3 Jun 2020 17:36:06 +0800
Subject: [PATCH 012/119] feat(grid): add new prop icon-size & badge (#3236)
fix #3223
---
example/pages/grid/index.wxml | 2 +-
packages/grid-item/index.ts | 3 +++
packages/grid-item/index.wxml | 2 +-
packages/grid/README.md | 7 ++++---
packages/grid/index.ts | 4 ++++
5 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/example/pages/grid/index.wxml b/example/pages/grid/index.wxml
index 56280724..1f1e0942 100644
--- a/example/pages/grid/index.wxml
+++ b/example/pages/grid/index.wxml
@@ -46,6 +46,6 @@
-
+
diff --git a/packages/grid-item/index.ts b/packages/grid-item/index.ts
index 1678b601..beaaeeee 100644
--- a/packages/grid-item/index.ts
+++ b/packages/grid-item/index.ts
@@ -17,6 +17,7 @@ VantComponent({
icon: String,
dot: Boolean,
info: null,
+ badge: null,
text: String,
useSlot: Boolean,
},
@@ -44,6 +45,7 @@ VantComponent({
clickable,
center,
direction,
+ iconSize,
} = data;
const width = `${100 / columnNum}%`;
@@ -85,6 +87,7 @@ VantComponent({
gutter,
clickable,
direction,
+ iconSize,
});
},
diff --git a/packages/grid-item/index.wxml b/packages/grid-item/index.wxml
index 57a96281..a27c06f1 100644
--- a/packages/grid-item/index.wxml
+++ b/packages/grid-item/index.wxml
@@ -10,7 +10,7 @@
-
+
diff --git a/packages/grid/README.md b/packages/grid/README.md
index 9ba1d8de..d788a385 100644
--- a/packages/grid/README.md
+++ b/packages/grid/README.md
@@ -100,12 +100,12 @@
### 提示信息
-设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标
+设置`dot`属性后,会在图标右上角展示一个小红点。设置`badge`属性后,会在图标右上角展示相应的徽标
```html
-
+
```
@@ -116,6 +116,7 @@
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| column-num | 列数 | _number_ | `4` | - |
+| icon-size `v1.3.2` | 图标大小,默认单位为`px` | _string_ | `28px` |
| gutter | 格子之间的间距,默认单位为`px` | _string \| number_ | `0` | - |
| border | 是否显示边框 | _boolean_ | `true` | - |
| center | 是否将格子内容居中显示 | _boolean_ | `true` | - |
@@ -136,7 +137,7 @@
| text | 文字 | _string_ | - | - |
| icon | 图标名称或图片链接,可选值见 [Icon 组件](#/icon) | _string_ | - | - |
| dot | 是否显示图标右上角小红点 | _boolean_ | `false` | - |
-| info | 图标右上角徽标的内容 | _string \| number_ | - | - |
+| badge | 图标右上角徽标的内容 | _string \| number_ | - | - |
| url | 点击后跳转的链接地址 | _string_ | - | - |
| link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | _string_ | `navigateTo` | - |
diff --git a/packages/grid/index.ts b/packages/grid/index.ts
index fdc1b32b..d81436c4 100644
--- a/packages/grid/index.ts
+++ b/packages/grid/index.ts
@@ -41,6 +41,10 @@ VantComponent({
type: String,
observer: 'updateChildren',
},
+ iconSize: {
+ type: String,
+ observer: 'updateChildren',
+ },
},
data: {
From 107782364acc3955ed7e25d91f9327d74ffc1d09 Mon Sep 17 00:00:00 2001
From: Lindy <33708359+Lindysen@users.noreply.github.com>
Date: Wed, 3 Jun 2020 17:50:02 +0800
Subject: [PATCH 013/119] fix(Grid): fix square item gutter bug (#3231)
---
packages/grid-item/index.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/grid-item/index.ts b/packages/grid-item/index.ts
index beaaeeee..ceecd1f7 100644
--- a/packages/grid-item/index.ts
+++ b/packages/grid-item/index.ts
@@ -61,7 +61,7 @@ VantComponent({
styleWrapper.push(`padding-right: ${gutterValue}`);
const index = children.indexOf(this);
- if (index >= columnNum) {
+ if (index >= columnNum && !square) {
styleWrapper.push(`margin-top: ${gutterValue}`);
}
}
From 547963140309b83a9afb5da02d16cbec55440612 Mon Sep 17 00:00:00 2001
From: rex
Date: Thu, 4 Jun 2020 12:02:52 +0800
Subject: [PATCH 014/119] docs(popup): add doc for scroll (#3238)
fix #3175
---
packages/popup/README.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/packages/popup/README.md b/packages/popup/README.md
index 51dfc643..38b791d5 100644
--- a/packages/popup/README.md
+++ b/packages/popup/README.md
@@ -103,6 +103,22 @@ Page({
/>
```
+## 常见问题
+
+### 组件滚动穿透该怎么解决?
+
+使用组件时,会发现内容部分滚动到底时,继续划动会导致页面的滚动,这就是滚动穿透。
+
+在web中,可以通过给 body 增加样式或者劫持内容部分的 `touchstart` 事件,判断后动态调用 `preventDefault` 来实现。不幸的是,这两种方法在小程序中都是不可行的,组件内部无法很好地处理滚动穿透问题。
+
+如果你有禁止滚动的需要,可以显式地 `catch` 组件的 `touchstart` 事件,不过需要注意的是,这也会禁止组件内容部分的滚动。
+```html
+
+```
+
## API
### Props
From 8aac1ebed07fb64c42f2720030224637761ae22c Mon Sep 17 00:00:00 2001
From: rex
Date: Thu, 4 Jun 2020 14:09:03 +0800
Subject: [PATCH 015/119] build: compile 1.3.2
---
dist/button/index.js | 8 +++-
dist/button/index.wxml | 1 +
dist/calendar/index.js | 5 ++-
dist/circle/canvas.d.ts | 6 +++
dist/circle/canvas.js | 43 +++++++++++++++++++
dist/circle/index.js | 73 ++++++++++++++++++++-----------
dist/circle/index.wxml | 4 +-
dist/common/version.d.ts | 1 +
dist/common/version.js | 4 ++
dist/grid-item/index.js | 16 ++++++-
dist/grid-item/index.wxml | 4 +-
dist/grid-item/index.wxss | 2 +-
dist/grid/index.js | 8 ++++
dist/tag/index.wxss | 2 +-
dist/uploader/index.wxml | 2 +-
lib/button/index.js | 8 +++-
lib/button/index.wxml | 1 +
lib/calendar/index.js | 5 ++-
lib/circle/canvas.js | 47 ++++++++++++++++++++
lib/circle/index.js | 90 ++++++++++++++++++++++++---------------
lib/circle/index.wxml | 4 +-
lib/common/version.js | 7 ++-
lib/grid-item/index.js | 9 +++-
lib/grid-item/index.wxml | 4 +-
lib/grid-item/index.wxss | 2 +-
lib/grid/index.js | 8 ++++
lib/tag/index.wxss | 2 +-
lib/uploader/index.wxml | 2 +-
28 files changed, 285 insertions(+), 83 deletions(-)
create mode 100644 dist/circle/canvas.d.ts
create mode 100644 dist/circle/canvas.js
create mode 100644 lib/circle/canvas.js
diff --git a/dist/button/index.js b/dist/button/index.js
index 9571e6b9..2dd7c883 100644
--- a/dist/button/index.js
+++ b/dist/button/index.js
@@ -1,13 +1,19 @@
import { VantComponent } from '../common/component';
import { button } from '../mixins/button';
import { openType } from '../mixins/open-type';
+import { canIUseFormFieldButton } from '../common/version';
+const mixins = [button, openType];
+if (canIUseFormFieldButton()) {
+ mixins.push('wx://form-field-button');
+}
VantComponent({
- mixins: [button, openType],
+ mixins,
classes: ['hover-class', 'loading-class'],
data: {
baseStyle: '',
},
props: {
+ formType: String,
icon: String,
classPrefix: {
type: String,
diff --git a/dist/button/index.wxml b/dist/button/index.wxml
index 30abac96..ab393e8f 100644
--- a/dist/button/index.wxml
+++ b/dist/button/index.wxml
@@ -6,6 +6,7 @@
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
hover-class="van-button--active hover-class"
lang="{{ lang }}"
+ form-type="{{ formType }}"
style="{{ baseStyle }} {{ customStyle }}"
open-type="{{ disabled ? '' : openType }}"
business-id="{{ businessId }}"
diff --git a/dist/calendar/index.js b/dist/calendar/index.js
index 447fc7a1..47117cbf 100644
--- a/dist/calendar/index.js
+++ b/dist/calendar/index.js
@@ -276,7 +276,10 @@ VantComponent({
return true;
},
onConfirm() {
- if (this.data.type === 'range' && !this.checkRange()) {
+ if (
+ this.data.type === 'range' &&
+ !this.checkRange(this.data.currentDate)
+ ) {
return;
}
wx.nextTick(() => {
diff --git a/dist/circle/canvas.d.ts b/dist/circle/canvas.d.ts
new file mode 100644
index 00000000..2ba9531d
--- /dev/null
+++ b/dist/circle/canvas.d.ts
@@ -0,0 +1,6 @@
+///
+declare type CanvasContext = WechatMiniprogram.CanvasContext;
+export declare function adaptor(
+ ctx: CanvasRenderingContext2D
+): CanvasContext & CanvasRenderingContext2D;
+export {};
diff --git a/dist/circle/canvas.js b/dist/circle/canvas.js
new file mode 100644
index 00000000..c311335e
--- /dev/null
+++ b/dist/circle/canvas.js
@@ -0,0 +1,43 @@
+export function adaptor(ctx) {
+ // @ts-ignore
+ return Object.assign(ctx, {
+ setStrokeStyle(val) {
+ ctx.strokeStyle = val;
+ },
+ setLineWidth(val) {
+ ctx.lineWidth = val;
+ },
+ setLineCap(val) {
+ ctx.lineCap = val;
+ },
+ setFillStyle(val) {
+ ctx.fillStyle = val;
+ },
+ setFontSize(val) {
+ ctx.font = String(val);
+ },
+ setGlobalAlpha(val) {
+ ctx.globalAlpha = val;
+ },
+ setLineJoin(val) {
+ ctx.lineJoin = val;
+ },
+ setTextAlign(val) {
+ ctx.textAlign = val;
+ },
+ setMiterLimit(val) {
+ ctx.miterLimit = val;
+ },
+ setShadow(offsetX, offsetY, blur, color) {
+ ctx.shadowOffsetX = offsetX;
+ ctx.shadowOffsetY = offsetY;
+ ctx.shadowBlur = blur;
+ ctx.shadowColor = color;
+ },
+ setTextBaseline(val) {
+ ctx.textBaseline = val;
+ },
+ createCircularGradient() {},
+ draw() {},
+ });
+}
diff --git a/dist/circle/index.js b/dist/circle/index.js
index 6f04c71e..c11fcf08 100644
--- a/dist/circle/index.js
+++ b/dist/circle/index.js
@@ -1,6 +1,7 @@
import { VantComponent } from '../common/component';
import { isObj } from '../common/utils';
import { BLUE, WHITE } from '../common/color';
+import { adaptor } from './canvas';
function format(rate) {
return Math.min(Math.max(rate, 0), 100);
}
@@ -26,6 +27,9 @@ VantComponent({
size: {
type: Number,
value: 100,
+ observer() {
+ this.drawCircle(this.currentValue);
+ },
},
fill: String,
layerColor: {
@@ -55,28 +59,45 @@ VantComponent({
},
methods: {
getContext() {
- if (!this.ctx) {
- this.ctx = wx.createCanvasContext('van-circle', this);
+ const { type } = this.data;
+ if (type === '') {
+ const ctx = wx.createCanvasContext('van-circle', this);
+ return Promise.resolve(ctx);
}
- return this.ctx;
+ const dpr = wx.getSystemInfoSync().pixelRatio;
+ return new Promise((resolve) => {
+ wx.createSelectorQuery()
+ .in(this)
+ .select('#van-circle')
+ .fields({ node: true, size: true })
+ .exec((res) => {
+ const canvas = res[0].node;
+ const ctx = canvas.getContext(type);
+ canvas.width = res[0].width * dpr;
+ canvas.height = res[0].height * dpr;
+ ctx.scale(dpr, dpr);
+ resolve(adaptor(ctx));
+ });
+ });
},
setHoverColor() {
- const { color, size, type } = this.data;
- const context = type ? this.getContext(type) : this.getContext();
+ const { color, size } = this.data;
let hoverColor = color;
- if (isObj(color)) {
- const LinearColor = context.createLinearGradient(size, 0, 0, 0);
- Object.keys(color)
- .sort((a, b) => parseFloat(a) - parseFloat(b))
- .map((key) =>
- LinearColor.addColorStop(parseFloat(key) / 100, color[key])
- );
- hoverColor = LinearColor;
- }
- this.setData({ hoverColor });
+ this.getContext().then((context) => {
+ if (isObj(color)) {
+ const LinearColor = context.createLinearGradient(size, 0, 0, 0);
+ Object.keys(color)
+ .sort((a, b) => parseFloat(a) - parseFloat(b))
+ .map((key) =>
+ LinearColor.addColorStop(parseFloat(key) / 100, color[key])
+ );
+ hoverColor = LinearColor;
+ }
+ this.setData({ hoverColor });
+ });
},
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
- const { strokeWidth, lineCap, clockwise, size } = this.data;
+ const { strokeWidth, lineCap, clockwise, size, type } = this.data;
const position = size / 2;
const radius = position - strokeWidth / 2;
context.setStrokeStyle(strokeStyle);
@@ -104,15 +125,16 @@ VantComponent({
this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle);
},
drawCircle(currentValue) {
- const { size, type } = this.data;
- const context = type ? this.getContext(type) : this.getContext();
- context.clearRect(0, 0, size, size);
- this.renderLayerCircle(context);
- const formatValue = format(currentValue);
- if (formatValue !== 0) {
- this.renderHoverCircle(context, formatValue);
- }
- context.draw();
+ const { size } = this.data;
+ this.getContext().then((context) => {
+ context.clearRect(0, 0, size, size);
+ this.renderLayerCircle(context);
+ const formatValue = format(currentValue);
+ if (formatValue !== 0) {
+ this.renderHoverCircle(context, formatValue);
+ }
+ context.draw();
+ });
},
reRender() {
// tofector 动画暂时没有想到好的解决方案
@@ -149,7 +171,6 @@ VantComponent({
this.drawCircle(value);
},
destroyed() {
- this.ctx = null;
this.clearInterval();
},
});
diff --git a/dist/circle/index.wxml b/dist/circle/index.wxml
index 607fc9d5..52bc59fc 100644
--- a/dist/circle/index.wxml
+++ b/dist/circle/index.wxml
@@ -1,9 +1,9 @@
-
+
{{ text }}
-
\ No newline at end of file
+
diff --git a/dist/common/version.d.ts b/dist/common/version.d.ts
index f69a9f61..d4c6fe24 100644
--- a/dist/common/version.d.ts
+++ b/dist/common/version.d.ts
@@ -1 +1,2 @@
export declare function canIUseModel(): boolean;
+export declare function canIUseFormFieldButton(): boolean;
diff --git a/dist/common/version.js b/dist/common/version.js
index a4f69619..01f24f88 100644
--- a/dist/common/version.js
+++ b/dist/common/version.js
@@ -25,3 +25,7 @@ export function canIUseModel() {
const system = getSystemInfoSync();
return compareVersion(system.SDKVersion, '2.9.3') >= 0;
}
+export function canIUseFormFieldButton() {
+ const system = getSystemInfoSync();
+ return compareVersion(system.SDKVersion, '2.10.3') >= 0;
+}
diff --git a/dist/grid-item/index.js b/dist/grid-item/index.js
index 88b97add..7a88a284 100644
--- a/dist/grid-item/index.js
+++ b/dist/grid-item/index.js
@@ -13,6 +13,7 @@ VantComponent({
icon: String,
dot: Boolean,
info: null,
+ badge: null,
text: String,
useSlot: Boolean,
},
@@ -28,7 +29,16 @@ VantComponent({
return;
}
const { data, children } = this.parent;
- const { columnNum, border, square, gutter, clickable, center } = data;
+ const {
+ columnNum,
+ border,
+ square,
+ gutter,
+ clickable,
+ center,
+ direction,
+ iconSize,
+ } = data;
const width = `${100 / columnNum}%`;
const styleWrapper = [];
styleWrapper.push(`width: ${width}`);
@@ -39,7 +49,7 @@ VantComponent({
const gutterValue = addUnit(gutter);
styleWrapper.push(`padding-right: ${gutterValue}`);
const index = children.indexOf(this);
- if (index >= columnNum) {
+ if (index >= columnNum && !square) {
styleWrapper.push(`margin-top: ${gutterValue}`);
}
}
@@ -60,6 +70,8 @@ VantComponent({
square,
gutter,
clickable,
+ direction,
+ iconSize,
});
},
onClick() {
diff --git a/dist/grid-item/index.wxml b/dist/grid-item/index.wxml
index 061f43c3..a27c06f1 100644
--- a/dist/grid-item/index.wxml
+++ b/dist/grid-item/index.wxml
@@ -2,7 +2,7 @@
@@ -10,7 +10,7 @@
-
+
diff --git a/dist/grid-item/index.wxss b/dist/grid-item/index.wxss
index 7f2e8182..b7e0301e 100644
--- a/dist/grid-item/index.wxss
+++ b/dist/grid-item/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{font-size:26px;font-size:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}
\ No newline at end of file
+@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}
\ No newline at end of file
diff --git a/dist/grid/index.js b/dist/grid/index.js
index aca001ba..a3bec16b 100644
--- a/dist/grid/index.js
+++ b/dist/grid/index.js
@@ -35,6 +35,14 @@ VantComponent({
value: true,
observer: 'updateChildren',
},
+ direction: {
+ type: String,
+ observer: 'updateChildren',
+ },
+ iconSize: {
+ type: String,
+ observer: 'updateChildren',
+ },
},
data: {
viewStyle: '',
diff --git a/dist/tag/index.wxss b/dist/tag/index.wxss
index 211e3769..0615a993 100644
--- a/dist/tag/index.wxss
+++ b/dist/tag/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-tag{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;line-height:normal;padding:.2em .5em;padding:var(--tag-padding,.2em .5em);color:#fff;color:var(--tag-text-color,#fff);font-size:10px;font-size:var(--tag-font-size,10px);border-radius:.2em;border-radius:var(--tag-border-radius,.2em)}.van-tag:after{border-color:currentColor;border-radius:.2em * 2;border-radius:var(--tag-border-radius,.2em) * 2}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-dander-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-dander-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--mark{padding-right:.7em}.van-tag--mark,.van-tag--mark:after{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--round,.van-tag--round:after{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag--medium{font-size:12px;font-size:var(--tag-medium-font-size,12px)}.van-tag--large{font-size:14px;font-size:var(--tag-large-font-size,14px)}.van-tag__close{margin-left:2px}
\ No newline at end of file
+@import '../common/index.wxss';.van-tag{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;line-height:normal;padding:.2em .5em;padding:var(--tag-padding,.2em .5em);color:#fff;color:var(--tag-text-color,#fff);font-size:10px;font-size:var(--tag-font-size,10px);border-radius:.2em;border-radius:var(--tag-border-radius,.2em)}.van-tag:after{border-color:currentColor;border-radius:.2em * 2;border-radius:var(--tag-border-radius,.2em) * 2}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-danger-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-danger-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--mark{padding-right:.7em}.van-tag--mark,.van-tag--mark:after{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--round,.van-tag--round:after{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag--medium{font-size:12px;font-size:var(--tag-medium-font-size,12px)}.van-tag--large{font-size:14px;font-size:var(--tag-large-font-size,14px)}.van-tag__close{margin-left:2px}
\ No newline at end of file
diff --git a/dist/uploader/index.wxml b/dist/uploader/index.wxml
index 9abcf47b..09f76563 100644
--- a/dist/uploader/index.wxml
+++ b/dist/uploader/index.wxml
@@ -42,7 +42,7 @@
name="clear"
class="van-uploader__preview-delete"
data-index="{{ index }}"
- bind:tap="deleteItem"
+ catch:tap="deleteItem"
/>
diff --git a/lib/button/index.js b/lib/button/index.js
index 665c47c5..d38d35db 100644
--- a/lib/button/index.js
+++ b/lib/button/index.js
@@ -3,13 +3,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
var button_1 = require('../mixins/button');
var open_type_1 = require('../mixins/open-type');
+var version_1 = require('../common/version');
+var mixins = [button_1.button, open_type_1.openType];
+if (version_1.canIUseFormFieldButton()) {
+ mixins.push('wx://form-field-button');
+}
component_1.VantComponent({
- mixins: [button_1.button, open_type_1.openType],
+ mixins: mixins,
classes: ['hover-class', 'loading-class'],
data: {
baseStyle: '',
},
props: {
+ formType: String,
icon: String,
classPrefix: {
type: String,
diff --git a/lib/button/index.wxml b/lib/button/index.wxml
index 30abac96..ab393e8f 100644
--- a/lib/button/index.wxml
+++ b/lib/button/index.wxml
@@ -6,6 +6,7 @@
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
hover-class="van-button--active hover-class"
lang="{{ lang }}"
+ form-type="{{ formType }}"
style="{{ baseStyle }} {{ customStyle }}"
open-type="{{ disabled ? '' : openType }}"
business-id="{{ businessId }}"
diff --git a/lib/calendar/index.js b/lib/calendar/index.js
index 370e76b2..699bbd81 100644
--- a/lib/calendar/index.js
+++ b/lib/calendar/index.js
@@ -304,7 +304,10 @@ component_1.VantComponent({
},
onConfirm: function () {
var _this = this;
- if (this.data.type === 'range' && !this.checkRange()) {
+ if (
+ this.data.type === 'range' &&
+ !this.checkRange(this.data.currentDate)
+ ) {
return;
}
wx.nextTick(function () {
diff --git a/lib/circle/canvas.js b/lib/circle/canvas.js
new file mode 100644
index 00000000..dbee1d73
--- /dev/null
+++ b/lib/circle/canvas.js
@@ -0,0 +1,47 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+exports.adaptor = void 0;
+function adaptor(ctx) {
+ // @ts-ignore
+ return Object.assign(ctx, {
+ setStrokeStyle: function (val) {
+ ctx.strokeStyle = val;
+ },
+ setLineWidth: function (val) {
+ ctx.lineWidth = val;
+ },
+ setLineCap: function (val) {
+ ctx.lineCap = val;
+ },
+ setFillStyle: function (val) {
+ ctx.fillStyle = val;
+ },
+ setFontSize: function (val) {
+ ctx.font = String(val);
+ },
+ setGlobalAlpha: function (val) {
+ ctx.globalAlpha = val;
+ },
+ setLineJoin: function (val) {
+ ctx.lineJoin = val;
+ },
+ setTextAlign: function (val) {
+ ctx.textAlign = val;
+ },
+ setMiterLimit: function (val) {
+ ctx.miterLimit = val;
+ },
+ setShadow: function (offsetX, offsetY, blur, color) {
+ ctx.shadowOffsetX = offsetX;
+ ctx.shadowOffsetY = offsetY;
+ ctx.shadowBlur = blur;
+ ctx.shadowColor = color;
+ },
+ setTextBaseline: function (val) {
+ ctx.textBaseline = val;
+ },
+ createCircularGradient: function () {},
+ draw: function () {},
+ });
+}
+exports.adaptor = adaptor;
diff --git a/lib/circle/index.js b/lib/circle/index.js
index 487666da..296011c8 100644
--- a/lib/circle/index.js
+++ b/lib/circle/index.js
@@ -3,6 +3,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
var utils_1 = require('../common/utils');
var color_1 = require('../common/color');
+var canvas_1 = require('./canvas');
function format(rate) {
return Math.min(Math.max(rate, 0), 100);
}
@@ -28,6 +29,9 @@ component_1.VantComponent({
size: {
type: Number,
value: 100,
+ observer: function () {
+ this.drawCircle(this.currentValue);
+ },
},
fill: String,
layerColor: {
@@ -57,40 +61,59 @@ component_1.VantComponent({
},
methods: {
getContext: function () {
- if (!this.ctx) {
- this.ctx = wx.createCanvasContext('van-circle', this);
+ var _this = this;
+ var type = this.data.type;
+ if (type === '') {
+ var ctx = wx.createCanvasContext('van-circle', this);
+ return Promise.resolve(ctx);
}
- return this.ctx;
+ var dpr = wx.getSystemInfoSync().pixelRatio;
+ return new Promise(function (resolve) {
+ wx.createSelectorQuery()
+ .in(_this)
+ .select('#van-circle')
+ .fields({ node: true, size: true })
+ .exec(function (res) {
+ var canvas = res[0].node;
+ var ctx = canvas.getContext(type);
+ canvas.width = res[0].width * dpr;
+ canvas.height = res[0].height * dpr;
+ ctx.scale(dpr, dpr);
+ resolve(canvas_1.adaptor(ctx));
+ });
+ });
},
setHoverColor: function () {
+ var _this = this;
var _a = this.data,
color = _a.color,
- size = _a.size,
- type = _a.type;
- var context = type ? this.getContext(type) : this.getContext();
+ size = _a.size;
var hoverColor = color;
- if (utils_1.isObj(color)) {
- var LinearColor_1 = context.createLinearGradient(size, 0, 0, 0);
- Object.keys(color)
- .sort(function (a, b) {
- return parseFloat(a) - parseFloat(b);
- })
- .map(function (key) {
- return LinearColor_1.addColorStop(
- parseFloat(key) / 100,
- color[key]
- );
- });
- hoverColor = LinearColor_1;
- }
- this.setData({ hoverColor: hoverColor });
+ this.getContext().then(function (context) {
+ if (utils_1.isObj(color)) {
+ var LinearColor_1 = context.createLinearGradient(size, 0, 0, 0);
+ Object.keys(color)
+ .sort(function (a, b) {
+ return parseFloat(a) - parseFloat(b);
+ })
+ .map(function (key) {
+ return LinearColor_1.addColorStop(
+ parseFloat(key) / 100,
+ color[key]
+ );
+ });
+ hoverColor = LinearColor_1;
+ }
+ _this.setData({ hoverColor: hoverColor });
+ });
},
presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) {
var _a = this.data,
strokeWidth = _a.strokeWidth,
lineCap = _a.lineCap,
clockwise = _a.clockwise,
- size = _a.size;
+ size = _a.size,
+ type = _a.type;
var position = size / 2;
var radius = position - strokeWidth / 2;
context.setStrokeStyle(strokeStyle);
@@ -122,17 +145,17 @@ component_1.VantComponent({
this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle);
},
drawCircle: function (currentValue) {
- var _a = this.data,
- size = _a.size,
- type = _a.type;
- var context = type ? this.getContext(type) : this.getContext();
- context.clearRect(0, 0, size, size);
- this.renderLayerCircle(context);
- var formatValue = format(currentValue);
- if (formatValue !== 0) {
- this.renderHoverCircle(context, formatValue);
- }
- context.draw();
+ var _this = this;
+ var size = this.data.size;
+ this.getContext().then(function (context) {
+ context.clearRect(0, 0, size, size);
+ _this.renderLayerCircle(context);
+ var formatValue = format(currentValue);
+ if (formatValue !== 0) {
+ _this.renderHoverCircle(context, formatValue);
+ }
+ context.draw();
+ });
},
reRender: function () {
var _this = this;
@@ -172,7 +195,6 @@ component_1.VantComponent({
this.drawCircle(value);
},
destroyed: function () {
- this.ctx = null;
this.clearInterval();
},
});
diff --git a/lib/circle/index.wxml b/lib/circle/index.wxml
index 607fc9d5..52bc59fc 100644
--- a/lib/circle/index.wxml
+++ b/lib/circle/index.wxml
@@ -1,9 +1,9 @@
-
+
{{ text }}
-
\ No newline at end of file
+
diff --git a/lib/common/version.js b/lib/common/version.js
index e0570922..50b90a56 100644
--- a/lib/common/version.js
+++ b/lib/common/version.js
@@ -1,6 +1,6 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
-exports.canIUseModel = void 0;
+exports.canIUseFormFieldButton = exports.canIUseModel = void 0;
var utils_1 = require('./utils');
function compareVersion(v1, v2) {
v1 = v1.split('.');
@@ -29,3 +29,8 @@ function canIUseModel() {
return compareVersion(system.SDKVersion, '2.9.3') >= 0;
}
exports.canIUseModel = canIUseModel;
+function canIUseFormFieldButton() {
+ var system = utils_1.getSystemInfoSync();
+ return compareVersion(system.SDKVersion, '2.10.3') >= 0;
+}
+exports.canIUseFormFieldButton = canIUseFormFieldButton;
diff --git a/lib/grid-item/index.js b/lib/grid-item/index.js
index fbf3508a..1888ff1d 100644
--- a/lib/grid-item/index.js
+++ b/lib/grid-item/index.js
@@ -15,6 +15,7 @@ component_1.VantComponent({
icon: String,
dot: Boolean,
info: null,
+ badge: null,
text: String,
useSlot: Boolean,
},
@@ -37,7 +38,9 @@ component_1.VantComponent({
square = data.square,
gutter = data.gutter,
clickable = data.clickable,
- center = data.center;
+ center = data.center,
+ direction = data.direction,
+ iconSize = data.iconSize;
var width = 100 / columnNum + '%';
var styleWrapper = [];
styleWrapper.push('width: ' + width);
@@ -48,7 +51,7 @@ component_1.VantComponent({
var gutterValue = utils_1.addUnit(gutter);
styleWrapper.push('padding-right: ' + gutterValue);
var index = children.indexOf(this);
- if (index >= columnNum) {
+ if (index >= columnNum && !square) {
styleWrapper.push('margin-top: ' + gutterValue);
}
}
@@ -70,6 +73,8 @@ component_1.VantComponent({
square: square,
gutter: gutter,
clickable: clickable,
+ direction: direction,
+ iconSize: iconSize,
});
},
onClick: function () {
diff --git a/lib/grid-item/index.wxml b/lib/grid-item/index.wxml
index 061f43c3..a27c06f1 100644
--- a/lib/grid-item/index.wxml
+++ b/lib/grid-item/index.wxml
@@ -2,7 +2,7 @@
@@ -10,7 +10,7 @@
-
+
diff --git a/lib/grid-item/index.wxss b/lib/grid-item/index.wxss
index 7f2e8182..b7e0301e 100644
--- a/lib/grid-item/index.wxss
+++ b/lib/grid-item/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{font-size:26px;font-size:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}
\ No newline at end of file
+@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}
\ No newline at end of file
diff --git a/lib/grid/index.js b/lib/grid/index.js
index 155a5814..cb5c067a 100644
--- a/lib/grid/index.js
+++ b/lib/grid/index.js
@@ -37,6 +37,14 @@ component_1.VantComponent({
value: true,
observer: 'updateChildren',
},
+ direction: {
+ type: String,
+ observer: 'updateChildren',
+ },
+ iconSize: {
+ type: String,
+ observer: 'updateChildren',
+ },
},
data: {
viewStyle: '',
diff --git a/lib/tag/index.wxss b/lib/tag/index.wxss
index 211e3769..0615a993 100644
--- a/lib/tag/index.wxss
+++ b/lib/tag/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-tag{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;line-height:normal;padding:.2em .5em;padding:var(--tag-padding,.2em .5em);color:#fff;color:var(--tag-text-color,#fff);font-size:10px;font-size:var(--tag-font-size,10px);border-radius:.2em;border-radius:var(--tag-border-radius,.2em)}.van-tag:after{border-color:currentColor;border-radius:.2em * 2;border-radius:var(--tag-border-radius,.2em) * 2}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-dander-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-dander-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--mark{padding-right:.7em}.van-tag--mark,.van-tag--mark:after{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--round,.van-tag--round:after{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag--medium{font-size:12px;font-size:var(--tag-medium-font-size,12px)}.van-tag--large{font-size:14px;font-size:var(--tag-large-font-size,14px)}.van-tag__close{margin-left:2px}
\ No newline at end of file
+@import '../common/index.wxss';.van-tag{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;line-height:normal;padding:.2em .5em;padding:var(--tag-padding,.2em .5em);color:#fff;color:var(--tag-text-color,#fff);font-size:10px;font-size:var(--tag-font-size,10px);border-radius:.2em;border-radius:var(--tag-border-radius,.2em)}.van-tag:after{border-color:currentColor;border-radius:.2em * 2;border-radius:var(--tag-border-radius,.2em) * 2}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-danger-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-danger-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--mark{padding-right:.7em}.van-tag--mark,.van-tag--mark:after{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--round,.van-tag--round:after{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag--medium{font-size:12px;font-size:var(--tag-medium-font-size,12px)}.van-tag--large{font-size:14px;font-size:var(--tag-large-font-size,14px)}.van-tag__close{margin-left:2px}
\ No newline at end of file
diff --git a/lib/uploader/index.wxml b/lib/uploader/index.wxml
index 9abcf47b..09f76563 100644
--- a/lib/uploader/index.wxml
+++ b/lib/uploader/index.wxml
@@ -42,7 +42,7 @@
name="clear"
class="van-uploader__preview-delete"
data-index="{{ index }}"
- bind:tap="deleteItem"
+ catch:tap="deleteItem"
/>
From 3f1d1498f6d6728e8b3575e36813034c4b260f11 Mon Sep 17 00:00:00 2001
From: rex
Date: Thu, 4 Jun 2020 14:09:07 +0800
Subject: [PATCH 016/119] build: release 1.3.2
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index c10c9dec..49da7961 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@vant/weapp",
- "version": "1.3.1",
+ "version": "1.3.2",
"author": "youzan",
"license": "MIT",
"miniprogram": "lib",
From 4f4e6af9a6bdd53fc04b3b9dbd6e9c19a30b4048 Mon Sep 17 00:00:00 2001
From: rex-zsd
Date: Thu, 4 Jun 2020 14:38:06 +0800
Subject: [PATCH 017/119] docs: release 1.3.2
---
docs/markdown/changelog.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/docs/markdown/changelog.md b/docs/markdown/changelog.md
index d0b2b1b2..5a62d558 100644
--- a/docs/markdown/changelog.md
+++ b/docs/markdown/changelog.md
@@ -1,5 +1,22 @@
# 更新日志
+### [v1.3.2](https://github.com/youzan/vant-weapp/tree/v1.3.2)
+`2020-06-04`
+
+**Features**
+
+- button: 新增 form-type 属性 [\#3208](https://github.com/youzan/vant-weapp/pull/3208)
+- grid: 新增 icon-size、badge 属性 [\#3236](https://github.com/youzan/vant-weapp/pull/3236)
+- grid: 新增 direction 属性 [\#3192](https://github.com/youzan/vant-weapp/pull/3192)
+
+**Bug Fixes**
+
+- Grid: 修复开启 `square` 时横、纵向间距不同 [\#3231](https://github.com/youzan/vant-weapp/pull/3231)
+- uploader: 修复点击删除图标时触发 click-preview 事件 [\#3230](https://github.com/youzan/vant-weapp/pull/3230)
+- circle: 修复 `type="2d"` 不生效 [\#3228](https://github.com/youzan/vant-weapp/pull/3228)
+- calendar: 修复在选择区间时,点击确定报错 [\#3195](https://github.com/youzan/vant-weapp/pull/3195)
+- tag: 修复 css 变量名拼写错误 [\#3191](https://github.com/youzan/vant-weapp/pull/3191)
+
### [v1.3.1](https://github.com/youzan/vant-weapp/tree/v1.3.1)
`2020-05-24`
From 67dfb120c37875ace0c4b7294f446553b153dc4f Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 9 Jun 2020 17:59:15 +0800
Subject: [PATCH 018/119] fix(nav-bar): fix style error with no left-text
(#3263)
fix #3250
---
example/pages/nav-bar/index.wxml | 3 +-
example/project.config.json | 2 +-
packages/nav-bar/index.less | 5 +++
packages/nav-bar/index.ts | 5 +--
packages/nav-bar/index.wxml | 54 +++++++++++++++++---------------
5 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/example/pages/nav-bar/index.wxml b/example/pages/nav-bar/index.wxml
index e25fb13a..b61ba556 100644
--- a/example/pages/nav-bar/index.wxml
+++ b/example/pages/nav-bar/index.wxml
@@ -1,7 +1,6 @@
-
+
diff --git a/example/project.config.json b/example/project.config.json
index 885a07ff..5f82a265 100644
--- a/example/project.config.json
+++ b/example/project.config.json
@@ -23,7 +23,7 @@
"disablePlugins": [],
"outputPath": ""
},
- "useCompilerModule": false,
+ "useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
diff --git a/packages/nav-bar/index.less b/packages/nav-bar/index.less
index 256bd8d1..e11d4b72 100644
--- a/packages/nav-bar/index.less
+++ b/packages/nav-bar/index.less
@@ -9,6 +9,10 @@
.theme(line-height, '@nav-bar-height');
.theme(background-color, '@nav-bar-background-color');
+ &__content {
+ position: relative;
+ }
+
&__text {
display: inline-block;
vertical-align: middle;
@@ -50,6 +54,7 @@
&__left,
&__right {
position: absolute;
+ top: 0;
bottom: 0;
display: flex;
align-items: center;
diff --git a/packages/nav-bar/index.ts b/packages/nav-bar/index.ts
index 3386e2f2..88c51b5b 100644
--- a/packages/nav-bar/index.ts
+++ b/packages/nav-bar/index.ts
@@ -1,4 +1,5 @@
import { VantComponent } from '../common/component';
+import { getSystemInfoSync } from '../common/utils';
VantComponent({
classes: ['title-class'],
@@ -38,14 +39,14 @@ VantComponent({
},
created() {
- const { statusBarHeight } = wx.getSystemInfoSync();
+ const { statusBarHeight } = getSystemInfoSync();
const { safeAreaInsetTop, zIndex } = this.data;
const paddingTop = safeAreaInsetTop ? statusBarHeight : 0;
const baseStyle = `z-index: ${zIndex};padding-top: ${paddingTop}px;`;
this.setData({
statusBarHeight,
height: 44 + statusBarHeight,
- baseStyle
+ baseStyle,
});
},
diff --git a/packages/nav-bar/index.wxml b/packages/nav-bar/index.wxml
index 941bf563..27ba8c96 100644
--- a/packages/nav-bar/index.wxml
+++ b/packages/nav-bar/index.wxml
@@ -4,36 +4,38 @@
-
-
-
+
+
+
+
+ {{ leftText }}
+
+
+
+
+ {{ title }}
+
+
+
{{ leftText }}
-
-
-
-
- {{ title }}
-
-
-
- {{ rightText }}
-
+ >{{ rightText }}
+
+
From e16d611f9427a2e38705c8c1736e66b6c1607680 Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 9 Jun 2020 20:59:39 +0800
Subject: [PATCH 019/119] fix(circle): can not set value dynamic (#3264)
fix #3239
---
packages/circle/index.ts | 50 ++++++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/packages/circle/index.ts b/packages/circle/index.ts
index c8292308..0a9f4f2f 100644
--- a/packages/circle/index.ts
+++ b/packages/circle/index.ts
@@ -41,7 +41,11 @@ VantComponent({
color: {
type: [String, Object],
value: BLUE,
- observer: 'setHoverColor',
+ observer() {
+ this.setHoverColor().then(() => {
+ this.drawCircle(this.currentValue);
+ });
+ },
},
type: {
type: String,
@@ -63,7 +67,7 @@ VantComponent({
methods: {
getContext() {
- const { type } = this.data;
+ const { type, size } = this.data;
if (type === '') {
const ctx = wx.createCanvasContext('van-circle', this);
@@ -76,14 +80,17 @@ VantComponent({
wx.createSelectorQuery()
.in(this)
.select('#van-circle')
- .fields({ node: true, size: true })
+ .node()
.exec((res) => {
const canvas = res[0].node;
const ctx = canvas.getContext(type);
- canvas.width = res[0].width * dpr;
- canvas.height = res[0].height * dpr;
- ctx.scale(dpr, dpr);
+ if (!this.inited) {
+ this.inited = true;
+ canvas.width = size * dpr;
+ canvas.height = size * dpr;
+ ctx.scale(dpr, dpr);
+ }
resolve(adaptor(ctx));
});
@@ -92,24 +99,25 @@ VantComponent({
setHoverColor() {
const { color, size } = this.data;
- let hoverColor = color;
- this.getContext().then((context) => {
- if (isObj(color)) {
+ if (isObj(color)) {
+ return this.getContext().then((context) => {
const LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color)
.sort((a, b) => parseFloat(a) - parseFloat(b))
.map((key) =>
LinearColor.addColorStop(parseFloat(key) / 100, color[key])
);
- hoverColor = LinearColor;
- }
+ this.hoverColor = LinearColor;
+ });
+ }
- this.setData({ hoverColor });
- });
+ this.hoverColor = color;
+ return Promise.resolve();
},
+
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
- const { strokeWidth, lineCap, clockwise, size, type } = this.data;
+ const { strokeWidth, lineCap, clockwise, size } = this.data;
const position = size / 2;
const radius = position - strokeWidth / 2;
@@ -133,14 +141,14 @@ VantComponent({
},
renderHoverCircle(context, formatValue) {
- const { clockwise, hoverColor } = this.data;
+ const { clockwise } = this.data;
// 结束角度
const progress = PERIMETER * (formatValue / 100);
const endAngle = clockwise
? BEGIN_ANGLE + progress
: 3 * Math.PI - (BEGIN_ANGLE + progress);
- this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle);
+ this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle);
},
drawCircle(currentValue) {
@@ -192,10 +200,12 @@ VantComponent({
},
},
- created() {
- const { value } = this.data;
- this.currentValue = value;
- this.drawCircle(value);
+ mounted() {
+ this.currentValue = this.data.value;
+
+ this.setHoverColor().then(() => {
+ this.drawCircle(this.currentValue);
+ });
},
destroyed() {
From 8456e58b4630f06d34592ef9b06c0210f45598a5 Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 9 Jun 2020 21:23:43 +0800
Subject: [PATCH 020/119] perf(uploader): expand delete area (#3265)
fix #3243
---
packages/uploader/index.less | 20 ++++++++++++++------
packages/uploader/index.wxml | 11 ++++++-----
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/packages/uploader/index.less b/packages/uploader/index.less
index 3a44e6df..8c6c3db0 100644
--- a/packages/uploader/index.less
+++ b/packages/uploader/index.less
@@ -66,12 +66,20 @@
&-delete {
position: absolute;
- top: -8px;
- right: -8px;
- color: @uploader-delete-color;
- font-size: @uploader-delete-icon-size;
- background-color: @uploader-delete-background-color;
- border-radius: 100%;
+ top: 0;
+ right: 0;
+ z-index: 1;
+ display: flex;
+ padding: 10px;
+ border-radius: 50%;
+ transform: translate(50%, -50%);
+
+ &__icon {
+ color: @uploader-delete-color;
+ font-size: @uploader-delete-icon-size;
+ background-color: @uploader-delete-background-color;
+ border-radius: 50%;
+ }
}
}
diff --git a/packages/uploader/index.wxml b/packages/uploader/index.wxml
index 09f76563..241e07f1 100644
--- a/packages/uploader/index.wxml
+++ b/packages/uploader/index.wxml
@@ -37,13 +37,14 @@
{{ item.message }}
-
+ >
+
+
@@ -57,7 +58,7 @@
wx:if="{{ showUpload }}"
class="van-uploader__upload {{ disabled ? 'van-uploader__upload--disabled': ''}}"
style="width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};"
- bind:tap="startUpload"
+ bindtap="startUpload"
>
{{ uploadText }}
From 9717d4170be5f8bec1220de70020ac90cc40107e Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 16 Jun 2020 21:21:42 +0800
Subject: [PATCH 021/119] fix(calendar): fix default-date not work in multiple
mode (#3284)
fix #3271
---
packages/calendar/index.ts | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/packages/calendar/index.ts b/packages/calendar/index.ts
index cecf91b8..00a899a7 100644
--- a/packages/calendar/index.ts
+++ b/packages/calendar/index.ts
@@ -165,7 +165,7 @@ VantComponent({
}
if (type === 'multiple') {
- return [defaultDate || minDate];
+ return defaultDate || [minDate];
}
return defaultDate || minDate;
@@ -316,7 +316,10 @@ VantComponent({
},
onConfirm() {
- if (this.data.type === 'range' && !this.checkRange(this.data.currentDate)) {
+ if (
+ this.data.type === 'range' &&
+ !this.checkRange(this.data.currentDate)
+ ) {
return;
}
wx.nextTick(() => {
From 9de507dd108e97937c74392b6b2bafe33f6e79a2 Mon Sep 17 00:00:00 2001
From: agoni1212 <22545824+agoni1212@users.noreply.github.com>
Date: Tue, 16 Jun 2020 21:22:28 +0800
Subject: [PATCH 022/119] Update Grid direction README (#3266)
* Update README.md
* Update README.md
---
packages/grid/README.md | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/packages/grid/README.md b/packages/grid/README.md
index d788a385..ddbde094 100644
--- a/packages/grid/README.md
+++ b/packages/grid/README.md
@@ -77,6 +77,18 @@
```
+### 内容横排
+
+将`direction`属性设置为`horizontal`,可以让宫格的内容呈横向排列
+
+```html
+
+
+
+
+
+```
+
### 页面跳转
可以通过`url`属性进行页面跳转,通过`link-type`属性控制跳转类型
@@ -122,6 +134,7 @@
| center | 是否将格子内容居中显示 | _boolean_ | `true` | - |
| square | 是否将格子固定为正方形 | _boolean_ | `false` | - |
| clickable | 是否开启格子点击反馈 | _boolean_ | `false` | - |
+| direction | 格子内容排列的方向,可选值为 `horizontal` | _string_ | `vertical` | - |
| use-slot | 是否使用自定义内容的插槽 | _boolean_ | `false` |
### Grid 外部样式类
From d35649e88f64555d9aece4e2ca0151a73d2c5ddf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=A2=96=E5=8D=9A?=
Date: Tue, 16 Jun 2020 21:25:43 +0800
Subject: [PATCH 023/119] =?UTF-8?q?fix:uploader=E7=BB=84=E4=BB=B6=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=8D=95=E5=BC=A0=E5=8F=AA=E8=AF=BB=E5=B1=9E=E6=80=A7?=
=?UTF-8?q?=20(#3270)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Update index.wxml
uploader组件,deletable属性只能控制全局是否可以删除,不能控制单张图片是否可删除,因此当fileList内为对象时,增加onlyRead标识,当onlyRead为true时,单张不显示删除icon;
* Update index.wxml
uploader组件,deletable属性只能控制全局是否可以删除,不能控制单张图片是否可删除,因此当fileList内为对象时,增加onlyRead标识,当onlyRead为true时,单张不显示删除icon;
* 补充upload deletable 文档
* Update index.wxml
* Update index.ts
Co-authored-by: wangyingbo <>
---
packages/uploader/README.md | 26 ++++++++++++++++++++++++++
packages/uploader/index.ts | 4 ++++
packages/uploader/index.wxml | 2 +-
3 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/packages/uploader/README.md b/packages/uploader/README.md
index d5026619..6ba1f0df 100644
--- a/packages/uploader/README.md
+++ b/packages/uploader/README.md
@@ -65,6 +65,32 @@ Page({
url: 'http://iph.href.lu/60x60?text=default',
name: '图片2',
isImage: true,
+ deletable: true,
+ },
+ ],
+ },
+});
+```
+
+### 图片编辑状态
+
+通过`deletable `可以标识所有图片或者单张图片是否可删除。如果`Props `的全局`deletable `为`false`,则所有图片都不展示删除按钮;如果`Props `的全局`deletable `为`true`,则可通过设置每一个图片对象里的`deletable `来控制每一张图片是否显示删除按钮,如果图片对象里不设置则默认为`true`。
+
+```html
+
+```
+
+```js
+Page({
+ data: {
+ fileList: [
+ {
+ url: 'https://img.yzcdn.cn/vant/leaf.jpg',
+ deletable: true,
+ },
+ {
+ url: 'https://img.yzcdn.cn/vant/tree.jpg',
+ deletable: false,
},
],
},
diff --git a/packages/uploader/index.ts b/packages/uploader/index.ts
index 3bc81240..412c6c62 100644
--- a/packages/uploader/index.ts
+++ b/packages/uploader/index.ts
@@ -77,6 +77,10 @@ VantComponent({
typeof item.isImage === 'undefined'
? isImageFile(item)
: item.isImage,
+ deletable:
+ typeof item.deletable === 'undefined'
+ ? true
+ : item.deletable,
}));
this.setData({ lists, isInCount: lists.length < maxCount });
},
diff --git a/packages/uploader/index.wxml b/packages/uploader/index.wxml
index 241e07f1..bce0a495 100644
--- a/packages/uploader/index.wxml
+++ b/packages/uploader/index.wxml
@@ -38,7 +38,7 @@
{{ item.message }}
Date: Wed, 24 Jun 2020 15:05:16 +0800
Subject: [PATCH 024/119] fix(grid): add margin-top for text with icon (#3310)
fix #3307
---
packages/grid-item/index.less | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/packages/grid-item/index.less b/packages/grid-item/index.less
index d824ab8a..289aa122 100644
--- a/packages/grid-item/index.less
+++ b/packages/grid-item/index.less
@@ -68,4 +68,8 @@
.theme(color, '@grid-item-text-color');
.theme(font-size, '@grid-item-text-font-size');
}
+
+ &__icon + &__text {
+ margin-top: 8px;
+ }
}
From 978b59650cbc0045826a51269ce0795b1a779367 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 24 Jun 2020 15:15:02 +0800
Subject: [PATCH 025/119] feat(field): add new external class label-class
(#3311)
fix #3285
---
packages/field/README.md | 1 +
packages/field/index.ts | 2 +-
packages/field/index.wxml | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/packages/field/README.md b/packages/field/README.md
index 7effe7fe..b9aeaae7 100644
--- a/packages/field/README.md
+++ b/packages/field/README.md
@@ -260,5 +260,6 @@ Page({
| 类名 | 说明 |
| ---------------- | -------------- |
+| label-class | 左侧文本样式类 |
| input-class | 输入框样式类 |
| right-icon-class | 右侧图标样式类 |
diff --git a/packages/field/index.ts b/packages/field/index.ts
index 700e0e88..80c05be7 100644
--- a/packages/field/index.ts
+++ b/packages/field/index.ts
@@ -6,7 +6,7 @@ import { canIUseModel } from '../common/version';
VantComponent({
field: true,
- classes: ['input-class', 'right-icon-class'],
+ classes: ['input-class', 'right-icon-class', 'label-class'],
props: {
...commonProps,
diff --git a/packages/field/index.wxml b/packages/field/index.wxml
index 140f05b7..c984d897 100644
--- a/packages/field/index.wxml
+++ b/packages/field/index.wxml
@@ -14,6 +14,7 @@
custom-style="{{ customStyle }}"
arrow-direction="{{ arrowDirection }}"
custom-class="van-field"
+ title-class="label-class"
>
From b7ded1282f68dfc7dc205d9732dd948589f6e003 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 24 Jun 2020 15:55:27 +0800
Subject: [PATCH 026/119] fix(field): always set value after input (#3313)
fix #3297
---
packages/field/index.ts | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/packages/field/index.ts b/packages/field/index.ts
index 80c05be7..c4123e8c 100644
--- a/packages/field/index.ts
+++ b/packages/field/index.ts
@@ -1,7 +1,6 @@
import { VantComponent } from '../common/component';
import { Weapp } from 'definitions/weapp';
import { commonProps, inputProps, textareaProps } from './props';
-import { canIUseModel } from '../common/version';
VantComponent({
field: true,
@@ -122,9 +121,7 @@ VantComponent({
},
emitChange() {
- if (canIUseModel()) {
- this.setData({ value: this.value });
- }
+ this.setData({ value: this.value });
wx.nextTick(() => {
this.$emit('input', this.value);
From 4e6efd1b8b9b9c79160128c9415b81092ac6846b Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 24 Jun 2020 16:12:24 +0800
Subject: [PATCH 027/119] fix(tabbar): fix style error in iphonese (#3314)
fix #2988
---
packages/tabbar/index.less | 1 +
1 file changed, 1 insertion(+)
diff --git a/packages/tabbar/index.less b/packages/tabbar/index.less
index 33624a64..53132bf3 100644
--- a/packages/tabbar/index.less
+++ b/packages/tabbar/index.less
@@ -3,6 +3,7 @@
.van-tabbar {
display: flex;
+ box-sizing: content-box;
width: 100%;
.theme(height, '@tabbar-height');
.theme(background-color, '@tabbar-background-color');
From c92f46756a524e154366ce200351b53b3bf93726 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 24 Jun 2020 17:06:01 +0800
Subject: [PATCH 028/119] feat(steps): add new steps properties inactiveIcon &
activeIcon (#3315)
fix #3111
---
example/pages/steps/index.js | 46 ++++++++++++++++++++--------------
example/pages/steps/index.wxml | 19 ++++++--------
packages/steps/README.md | 41 ++++++++++++++++++++++++++++++
packages/steps/index.wxml | 6 ++---
4 files changed, 79 insertions(+), 33 deletions(-)
diff --git a/example/pages/steps/index.js b/example/pages/steps/index.js
index 44f710e7..84985871 100644
--- a/example/pages/steps/index.js
+++ b/example/pages/steps/index.js
@@ -1,32 +1,40 @@
import Page from '../../common/page';
import Toast from '../../dist/toast/toast';
+import icons from '../../dist/@vant/icons/src/config';
+
+const steps = [
+ {
+ text: '步骤一',
+ desc: '描述信息',
+ },
+ {
+ text: '步骤二',
+ desc: '描述信息',
+ },
+ {
+ text: '步骤三',
+ desc: '描述信息',
+ },
+ {
+ text: '步骤四',
+ desc: '描述信息',
+ },
+];
Page({
data: {
active: 1,
- steps: [
- {
- text: '步骤一',
- desc: '描述信息'
- },
- {
- text: '步骤二',
- desc: '描述信息'
- },
- {
- text: '步骤三',
- desc: '描述信息'
- },
- {
- text: '步骤四',
- desc: '描述信息'
- }
- ]
+ steps,
+ customIconSteps: steps.map((item, index) => ({
+ ...item,
+ inactiveIcon: icons.outline[index],
+ activeIcon: icons.basic[index],
+ })),
},
nextStep() {
this.setData({
- active: ++this.data.active % 4
+ active: ++this.data.active % 4,
});
},
diff --git a/example/pages/steps/index.wxml b/example/pages/steps/index.wxml
index c351b839..5bb24f6b 100644
--- a/example/pages/steps/index.wxml
+++ b/example/pages/steps/index.wxml
@@ -2,6 +2,7 @@
@@ -18,6 +19,13 @@
/>
+
+
+
+
-
-
-
- 下一步
-
-
diff --git a/packages/steps/README.md b/packages/steps/README.md
index b48a1e82..b344e82f 100644
--- a/packages/steps/README.md
+++ b/packages/steps/README.md
@@ -56,6 +56,47 @@ Page({
/>
```
+### 自定义图标
+
+可以通过 `inactiveIcon` 和 `activeIcon` 属性分别设置每一项的图标
+
+```html
+
+```
+
+```javascript
+Page({
+ data: {
+ steps: [
+ {
+ text: '步骤一',
+ desc: '描述信息',
+ inactiveIcon: 'location-o',
+ activeIcon: 'success',
+ },
+ {
+ text: '步骤二',
+ desc: '描述信息',
+ inactiveIcon: 'like-o',
+ activeIcon: 'plus',
+ },
+ {
+ text: '步骤三',
+ desc: '描述信息',
+ inactiveIcon: 'star-o',
+ activeIcon: 'cross',
+ },
+ {
+ text: '步骤四',
+ desc: '描述信息',
+ inactiveIcon: 'phone-o',
+ activeIcon: 'fail',
+ },
+ ],
+ },
+});
+```
+
### 竖向步骤条
可以通过设置`direction`属性来改变步骤条的显示方式
diff --git a/packages/steps/index.wxml b/packages/steps/index.wxml
index af31094f..6180b417 100644
--- a/packages/steps/index.wxml
+++ b/packages/steps/index.wxml
@@ -17,9 +17,9 @@
-
+
Date: Wed, 24 Jun 2020 17:08:49 +0800
Subject: [PATCH 029/119] build: compile 1.3.3
---
dist/calendar/index.js | 2 +-
dist/circle/index.js | 48 ++++++++++++++++++-------------
dist/field/index.js | 7 ++---
dist/field/index.wxml | 1 +
dist/grid-item/index.wxss | 2 +-
dist/nav-bar/index.js | 3 +-
dist/nav-bar/index.wxml | 54 ++++++++++++++++++-----------------
dist/nav-bar/index.wxss | 2 +-
dist/steps/index.wxml | 6 ++--
dist/tabbar/index.wxss | 2 +-
dist/uploader/index.js | 2 ++
dist/uploader/index.wxml | 13 +++++----
dist/uploader/index.wxss | 2 +-
lib/calendar/index.js | 2 +-
lib/circle/index.js | 59 ++++++++++++++++++++++-----------------
lib/field/index.js | 7 ++---
lib/field/index.wxml | 1 +
lib/grid-item/index.wxss | 2 +-
lib/nav-bar/index.js | 3 +-
lib/nav-bar/index.wxml | 54 ++++++++++++++++++-----------------
lib/nav-bar/index.wxss | 2 +-
lib/steps/index.wxml | 6 ++--
lib/tabbar/index.wxss | 2 +-
lib/uploader/index.js | 2 ++
lib/uploader/index.wxml | 13 +++++----
lib/uploader/index.wxss | 2 +-
26 files changed, 162 insertions(+), 137 deletions(-)
diff --git a/dist/calendar/index.js b/dist/calendar/index.js
index 47117cbf..e953c6f4 100644
--- a/dist/calendar/index.js
+++ b/dist/calendar/index.js
@@ -152,7 +152,7 @@ VantComponent({
];
}
if (type === 'multiple') {
- return [defaultDate || minDate];
+ return defaultDate || [minDate];
}
return defaultDate || minDate;
},
diff --git a/dist/circle/index.js b/dist/circle/index.js
index c11fcf08..3feaa5c8 100644
--- a/dist/circle/index.js
+++ b/dist/circle/index.js
@@ -39,7 +39,11 @@ VantComponent({
color: {
type: [String, Object],
value: BLUE,
- observer: 'setHoverColor',
+ observer() {
+ this.setHoverColor().then(() => {
+ this.drawCircle(this.currentValue);
+ });
+ },
},
type: {
type: String,
@@ -59,7 +63,7 @@ VantComponent({
},
methods: {
getContext() {
- const { type } = this.data;
+ const { type, size } = this.data;
if (type === '') {
const ctx = wx.createCanvasContext('van-circle', this);
return Promise.resolve(ctx);
@@ -69,35 +73,38 @@ VantComponent({
wx.createSelectorQuery()
.in(this)
.select('#van-circle')
- .fields({ node: true, size: true })
+ .node()
.exec((res) => {
const canvas = res[0].node;
const ctx = canvas.getContext(type);
- canvas.width = res[0].width * dpr;
- canvas.height = res[0].height * dpr;
- ctx.scale(dpr, dpr);
+ if (!this.inited) {
+ this.inited = true;
+ canvas.width = size * dpr;
+ canvas.height = size * dpr;
+ ctx.scale(dpr, dpr);
+ }
resolve(adaptor(ctx));
});
});
},
setHoverColor() {
const { color, size } = this.data;
- let hoverColor = color;
- this.getContext().then((context) => {
- if (isObj(color)) {
+ if (isObj(color)) {
+ return this.getContext().then((context) => {
const LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color)
.sort((a, b) => parseFloat(a) - parseFloat(b))
.map((key) =>
LinearColor.addColorStop(parseFloat(key) / 100, color[key])
);
- hoverColor = LinearColor;
- }
- this.setData({ hoverColor });
- });
+ this.hoverColor = LinearColor;
+ });
+ }
+ this.hoverColor = color;
+ return Promise.resolve();
},
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
- const { strokeWidth, lineCap, clockwise, size, type } = this.data;
+ const { strokeWidth, lineCap, clockwise, size } = this.data;
const position = size / 2;
const radius = position - strokeWidth / 2;
context.setStrokeStyle(strokeStyle);
@@ -116,13 +123,13 @@ VantComponent({
this.presetCanvas(context, layerColor, 0, PERIMETER, fill);
},
renderHoverCircle(context, formatValue) {
- const { clockwise, hoverColor } = this.data;
+ const { clockwise } = this.data;
// 结束角度
const progress = PERIMETER * (formatValue / 100);
const endAngle = clockwise
? BEGIN_ANGLE + progress
: 3 * Math.PI - (BEGIN_ANGLE + progress);
- this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle);
+ this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle);
},
drawCircle(currentValue) {
const { size } = this.data;
@@ -165,10 +172,11 @@ VantComponent({
}
},
},
- created() {
- const { value } = this.data;
- this.currentValue = value;
- this.drawCircle(value);
+ mounted() {
+ this.currentValue = this.data.value;
+ this.setHoverColor().then(() => {
+ this.drawCircle(this.currentValue);
+ });
},
destroyed() {
this.clearInterval();
diff --git a/dist/field/index.js b/dist/field/index.js
index 5e7d78a3..6bfade57 100644
--- a/dist/field/index.js
+++ b/dist/field/index.js
@@ -1,9 +1,8 @@
import { VantComponent } from '../common/component';
import { commonProps, inputProps, textareaProps } from './props';
-import { canIUseModel } from '../common/version';
VantComponent({
field: true,
- classes: ['input-class', 'right-icon-class'],
+ classes: ['input-class', 'right-icon-class', 'label-class'],
props: Object.assign(
Object.assign(
Object.assign(Object.assign({}, commonProps), inputProps),
@@ -105,9 +104,7 @@ VantComponent({
this.$emit('keyboardheightchange', event.detail);
},
emitChange() {
- if (canIUseModel()) {
- this.setData({ value: this.value });
- }
+ this.setData({ value: this.value });
wx.nextTick(() => {
this.$emit('input', this.value);
this.$emit('change', this.value);
diff --git a/dist/field/index.wxml b/dist/field/index.wxml
index 140f05b7..c984d897 100644
--- a/dist/field/index.wxml
+++ b/dist/field/index.wxml
@@ -14,6 +14,7 @@
custom-style="{{ customStyle }}"
arrow-direction="{{ arrowDirection }}"
custom-class="van-field"
+ title-class="label-class"
>
diff --git a/dist/grid-item/index.wxss b/dist/grid-item/index.wxss
index b7e0301e..ed7facb8 100644
--- a/dist/grid-item/index.wxss
+++ b/dist/grid-item/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}
\ No newline at end of file
+@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}
\ No newline at end of file
diff --git a/dist/nav-bar/index.js b/dist/nav-bar/index.js
index afed24e7..b94132fa 100644
--- a/dist/nav-bar/index.js
+++ b/dist/nav-bar/index.js
@@ -1,4 +1,5 @@
import { VantComponent } from '../common/component';
+import { getSystemInfoSync } from '../common/utils';
VantComponent({
classes: ['title-class'],
props: {
@@ -34,7 +35,7 @@ VantComponent({
baseStyle: '',
},
created() {
- const { statusBarHeight } = wx.getSystemInfoSync();
+ const { statusBarHeight } = getSystemInfoSync();
const { safeAreaInsetTop, zIndex } = this.data;
const paddingTop = safeAreaInsetTop ? statusBarHeight : 0;
const baseStyle = `z-index: ${zIndex};padding-top: ${paddingTop}px;`;
diff --git a/dist/nav-bar/index.wxml b/dist/nav-bar/index.wxml
index 941bf563..27ba8c96 100644
--- a/dist/nav-bar/index.wxml
+++ b/dist/nav-bar/index.wxml
@@ -4,36 +4,38 @@
-
-
-
+
+
+
+
+ {{ leftText }}
+
+
+
+
+ {{ title }}
+
+
+
{{ leftText }}
-
-
-
-
- {{ title }}
-
-
-
- {{ rightText }}
-
+ >{{ rightText }}
+
+
diff --git a/dist/nav-bar/index.wxss b/dist/nav-bar/index.wxss
index 01fd3bd7..a2331281 100644
--- a/dist/nav-bar/index.wxss
+++ b/dist/nav-bar/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-nav-bar{position:relative;text-align:center;-webkit-user-select:none;user-select:none;height:44px;height:var(--nav-bar-height,44px);line-height:44px;line-height:var(--nav-bar-height,44px);background-color:#fff;background-color:var(--nav-bar-background-color,#fff)}.van-nav-bar__text{display:inline-block;vertical-align:middle;margin:0 -16px;margin:0 -var(--padding-md,16px);padding:0 16px;padding:0 var(--padding-md,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__text--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-nav-bar__arrow{vertical-align:middle;font-size:16px;font-size:var(--nav-bar-arrow-size,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar__title{max-width:60%;margin:0 auto;color:#323233;color:var(--nav-bar-title-text-color,#323233);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--nav-bar-title-font-size,16px)}.van-nav-bar__left,.van-nav-bar__right{position:absolute;bottom:0;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:14px;font-size:var(--font-size-md,14px)}.van-nav-bar__left{left:16px;left:var(--padding-md,16px)}.van-nav-bar__right{right:16px;right:var(--padding-md,16px)}
\ No newline at end of file
+@import '../common/index.wxss';.van-nav-bar{text-align:center;-webkit-user-select:none;user-select:none;height:44px;height:var(--nav-bar-height,44px);line-height:44px;line-height:var(--nav-bar-height,44px);background-color:#fff;background-color:var(--nav-bar-background-color,#fff)}.van-nav-bar,.van-nav-bar__content{position:relative}.van-nav-bar__text{display:inline-block;vertical-align:middle;margin:0 -16px;margin:0 -var(--padding-md,16px);padding:0 16px;padding:0 var(--padding-md,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__text--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-nav-bar__arrow{vertical-align:middle;font-size:16px;font-size:var(--nav-bar-arrow-size,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar__title{max-width:60%;margin:0 auto;color:#323233;color:var(--nav-bar-title-text-color,#323233);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--nav-bar-title-font-size,16px)}.van-nav-bar__left,.van-nav-bar__right{position:absolute;top:0;bottom:0;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:14px;font-size:var(--font-size-md,14px)}.van-nav-bar__left{left:16px;left:var(--padding-md,16px)}.van-nav-bar__right{right:16px;right:var(--padding-md,16px)}
\ No newline at end of file
diff --git a/dist/steps/index.wxml b/dist/steps/index.wxml
index af31094f..6180b417 100644
--- a/dist/steps/index.wxml
+++ b/dist/steps/index.wxml
@@ -17,9 +17,9 @@
-
+
{{ item.message }}
-
+ >
+
+
@@ -57,7 +58,7 @@
wx:if="{{ showUpload }}"
class="van-uploader__upload {{ disabled ? 'van-uploader__upload--disabled': ''}}"
style="width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};"
- bind:tap="startUpload"
+ bindtap="startUpload"
>
{{ uploadText }}
diff --git a/dist/uploader/index.wxss b/dist/uploader/index.wxss
index da44e472..b1fd9592 100644
--- a/dist/uploader/index.wxss
+++ b/dist/uploader/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#f7f8fa;border-radius:8px}.van-uploader__upload:active{background-color:#f2f3f5}.van-uploader__upload-icon{color:#dcdee0;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__upload--disabled{opacity:.5;opacity:var(--uploader-disabled-opacity,.5)}.van-uploader__preview{position:relative;margin:0 8px 8px 0;cursor:pointer}.van-uploader__preview-image{display:block;width:80px;height:80px;overflow:hidden;border-radius:8px}.van-uploader__preview-delete{position:absolute;top:-8px;right:-8px;color:#969799;font-size:18px;background-color:#fff;border-radius:100%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:8px}.van-uploader__file-icon{color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 4px;color:#646566;font-size:12px;text-align:center}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;color:#fff;background-color:rgba(50,50,51,.88);border-radius:8px}.van-uploader__mask-icon{font-size:22px}.van-uploader__mask-message{margin-top:6px;padding:0 4px;font-size:12px;line-height:14px}.van-uploader__loading{width:22px;height:22px;color:#fff}
\ No newline at end of file
+@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#f7f8fa;border-radius:8px}.van-uploader__upload:active{background-color:#f2f3f5}.van-uploader__upload-icon{color:#dcdee0;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__upload--disabled{opacity:.5;opacity:var(--uploader-disabled-opacity,.5)}.van-uploader__preview{position:relative;margin:0 8px 8px 0;cursor:pointer}.van-uploader__preview-image{display:block;width:80px;height:80px;overflow:hidden;border-radius:8px}.van-uploader__preview-delete{position:absolute;top:0;right:0;z-index:1;display:-webkit-flex;display:flex;padding:10px;border-radius:50%;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%)}.van-uploader__preview-delete__icon{color:#969799;font-size:18px;background-color:#fff;border-radius:50%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:8px}.van-uploader__file-icon{color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 4px;color:#646566;font-size:12px;text-align:center}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;color:#fff;background-color:rgba(50,50,51,.88);border-radius:8px}.van-uploader__mask-icon{font-size:22px}.van-uploader__mask-message{margin-top:6px;padding:0 4px;font-size:12px;line-height:14px}.van-uploader__loading{width:22px;height:22px;color:#fff}
\ No newline at end of file
diff --git a/lib/calendar/index.js b/lib/calendar/index.js
index 699bbd81..e2b2ce13 100644
--- a/lib/calendar/index.js
+++ b/lib/calendar/index.js
@@ -167,7 +167,7 @@ component_1.VantComponent({
];
}
if (type === 'multiple') {
- return [defaultDate || minDate];
+ return defaultDate || [minDate];
}
return defaultDate || minDate;
},
diff --git a/lib/circle/index.js b/lib/circle/index.js
index 296011c8..5c34f803 100644
--- a/lib/circle/index.js
+++ b/lib/circle/index.js
@@ -41,7 +41,12 @@ component_1.VantComponent({
color: {
type: [String, Object],
value: color_1.BLUE,
- observer: 'setHoverColor',
+ observer: function () {
+ var _this = this;
+ this.setHoverColor().then(function () {
+ _this.drawCircle(_this.currentValue);
+ });
+ },
},
type: {
type: String,
@@ -62,7 +67,9 @@ component_1.VantComponent({
methods: {
getContext: function () {
var _this = this;
- var type = this.data.type;
+ var _a = this.data,
+ type = _a.type,
+ size = _a.size;
if (type === '') {
var ctx = wx.createCanvasContext('van-circle', this);
return Promise.resolve(ctx);
@@ -72,13 +79,16 @@ component_1.VantComponent({
wx.createSelectorQuery()
.in(_this)
.select('#van-circle')
- .fields({ node: true, size: true })
+ .node()
.exec(function (res) {
var canvas = res[0].node;
var ctx = canvas.getContext(type);
- canvas.width = res[0].width * dpr;
- canvas.height = res[0].height * dpr;
- ctx.scale(dpr, dpr);
+ if (!_this.inited) {
+ _this.inited = true;
+ canvas.width = size * dpr;
+ canvas.height = size * dpr;
+ ctx.scale(dpr, dpr);
+ }
resolve(canvas_1.adaptor(ctx));
});
});
@@ -88,32 +98,31 @@ component_1.VantComponent({
var _a = this.data,
color = _a.color,
size = _a.size;
- var hoverColor = color;
- this.getContext().then(function (context) {
- if (utils_1.isObj(color)) {
- var LinearColor_1 = context.createLinearGradient(size, 0, 0, 0);
+ if (utils_1.isObj(color)) {
+ return this.getContext().then(function (context) {
+ var LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color)
.sort(function (a, b) {
return parseFloat(a) - parseFloat(b);
})
.map(function (key) {
- return LinearColor_1.addColorStop(
+ return LinearColor.addColorStop(
parseFloat(key) / 100,
color[key]
);
});
- hoverColor = LinearColor_1;
- }
- _this.setData({ hoverColor: hoverColor });
- });
+ _this.hoverColor = LinearColor;
+ });
+ }
+ this.hoverColor = color;
+ return Promise.resolve();
},
presetCanvas: function (context, strokeStyle, beginAngle, endAngle, fill) {
var _a = this.data,
strokeWidth = _a.strokeWidth,
lineCap = _a.lineCap,
clockwise = _a.clockwise,
- size = _a.size,
- type = _a.type;
+ size = _a.size;
var position = size / 2;
var radius = position - strokeWidth / 2;
context.setStrokeStyle(strokeStyle);
@@ -134,15 +143,13 @@ component_1.VantComponent({
this.presetCanvas(context, layerColor, 0, PERIMETER, fill);
},
renderHoverCircle: function (context, formatValue) {
- var _a = this.data,
- clockwise = _a.clockwise,
- hoverColor = _a.hoverColor;
+ var clockwise = this.data.clockwise;
// 结束角度
var progress = PERIMETER * (formatValue / 100);
var endAngle = clockwise
? BEGIN_ANGLE + progress
: 3 * Math.PI - (BEGIN_ANGLE + progress);
- this.presetCanvas(context, hoverColor, BEGIN_ANGLE, endAngle);
+ this.presetCanvas(context, this.hoverColor, BEGIN_ANGLE, endAngle);
},
drawCircle: function (currentValue) {
var _this = this;
@@ -189,10 +196,12 @@ component_1.VantComponent({
}
},
},
- created: function () {
- var value = this.data.value;
- this.currentValue = value;
- this.drawCircle(value);
+ mounted: function () {
+ var _this = this;
+ this.currentValue = this.data.value;
+ this.setHoverColor().then(function () {
+ _this.drawCircle(_this.currentValue);
+ });
},
destroyed: function () {
this.clearInterval();
diff --git a/lib/field/index.js b/lib/field/index.js
index d26c164f..764114e5 100644
--- a/lib/field/index.js
+++ b/lib/field/index.js
@@ -17,10 +17,9 @@ var __assign =
Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
var props_1 = require('./props');
-var version_1 = require('../common/version');
component_1.VantComponent({
field: true,
- classes: ['input-class', 'right-icon-class'],
+ classes: ['input-class', 'right-icon-class', 'label-class'],
props: __assign(
__assign(
__assign(__assign({}, props_1.commonProps), props_1.inputProps),
@@ -126,9 +125,7 @@ component_1.VantComponent({
},
emitChange: function () {
var _this = this;
- if (version_1.canIUseModel()) {
- this.setData({ value: this.value });
- }
+ this.setData({ value: this.value });
wx.nextTick(function () {
_this.$emit('input', _this.value);
_this.$emit('change', _this.value);
diff --git a/lib/field/index.wxml b/lib/field/index.wxml
index 140f05b7..c984d897 100644
--- a/lib/field/index.wxml
+++ b/lib/field/index.wxml
@@ -14,6 +14,7 @@
custom-style="{{ customStyle }}"
arrow-direction="{{ arrowDirection }}"
custom-class="van-field"
+ title-class="label-class"
>
diff --git a/lib/grid-item/index.wxss b/lib/grid-item/index.wxss
index b7e0301e..ed7facb8 100644
--- a/lib/grid-item/index.wxss
+++ b/lib/grid-item/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}
\ No newline at end of file
+@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}
\ No newline at end of file
diff --git a/lib/nav-bar/index.js b/lib/nav-bar/index.js
index 2894d294..fb4fd97a 100644
--- a/lib/nav-bar/index.js
+++ b/lib/nav-bar/index.js
@@ -1,6 +1,7 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
+var utils_1 = require('../common/utils');
component_1.VantComponent({
classes: ['title-class'],
props: {
@@ -36,7 +37,7 @@ component_1.VantComponent({
baseStyle: '',
},
created: function () {
- var statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
+ var statusBarHeight = utils_1.getSystemInfoSync().statusBarHeight;
var _a = this.data,
safeAreaInsetTop = _a.safeAreaInsetTop,
zIndex = _a.zIndex;
diff --git a/lib/nav-bar/index.wxml b/lib/nav-bar/index.wxml
index 941bf563..27ba8c96 100644
--- a/lib/nav-bar/index.wxml
+++ b/lib/nav-bar/index.wxml
@@ -4,36 +4,38 @@
-
-
-
+
+
+
+
+ {{ leftText }}
+
+
+
+
+ {{ title }}
+
+
+
{{ leftText }}
-
-
-
-
- {{ title }}
-
-
-
- {{ rightText }}
-
+ >{{ rightText }}
+
+
diff --git a/lib/nav-bar/index.wxss b/lib/nav-bar/index.wxss
index 01fd3bd7..a2331281 100644
--- a/lib/nav-bar/index.wxss
+++ b/lib/nav-bar/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-nav-bar{position:relative;text-align:center;-webkit-user-select:none;user-select:none;height:44px;height:var(--nav-bar-height,44px);line-height:44px;line-height:var(--nav-bar-height,44px);background-color:#fff;background-color:var(--nav-bar-background-color,#fff)}.van-nav-bar__text{display:inline-block;vertical-align:middle;margin:0 -16px;margin:0 -var(--padding-md,16px);padding:0 16px;padding:0 var(--padding-md,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__text--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-nav-bar__arrow{vertical-align:middle;font-size:16px;font-size:var(--nav-bar-arrow-size,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar__title{max-width:60%;margin:0 auto;color:#323233;color:var(--nav-bar-title-text-color,#323233);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--nav-bar-title-font-size,16px)}.van-nav-bar__left,.van-nav-bar__right{position:absolute;bottom:0;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:14px;font-size:var(--font-size-md,14px)}.van-nav-bar__left{left:16px;left:var(--padding-md,16px)}.van-nav-bar__right{right:16px;right:var(--padding-md,16px)}
\ No newline at end of file
+@import '../common/index.wxss';.van-nav-bar{text-align:center;-webkit-user-select:none;user-select:none;height:44px;height:var(--nav-bar-height,44px);line-height:44px;line-height:var(--nav-bar-height,44px);background-color:#fff;background-color:var(--nav-bar-background-color,#fff)}.van-nav-bar,.van-nav-bar__content{position:relative}.van-nav-bar__text{display:inline-block;vertical-align:middle;margin:0 -16px;margin:0 -var(--padding-md,16px);padding:0 16px;padding:0 var(--padding-md,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__text--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-nav-bar__arrow{vertical-align:middle;font-size:16px;font-size:var(--nav-bar-arrow-size,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar__title{max-width:60%;margin:0 auto;color:#323233;color:var(--nav-bar-title-text-color,#323233);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--nav-bar-title-font-size,16px)}.van-nav-bar__left,.van-nav-bar__right{position:absolute;top:0;bottom:0;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:14px;font-size:var(--font-size-md,14px)}.van-nav-bar__left{left:16px;left:var(--padding-md,16px)}.van-nav-bar__right{right:16px;right:var(--padding-md,16px)}
\ No newline at end of file
diff --git a/lib/steps/index.wxml b/lib/steps/index.wxml
index af31094f..6180b417 100644
--- a/lib/steps/index.wxml
+++ b/lib/steps/index.wxml
@@ -17,9 +17,9 @@
-
+
{{ item.message }}
-
+ >
+
+
@@ -57,7 +58,7 @@
wx:if="{{ showUpload }}"
class="van-uploader__upload {{ disabled ? 'van-uploader__upload--disabled': ''}}"
style="width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};"
- bind:tap="startUpload"
+ bindtap="startUpload"
>
{{ uploadText }}
diff --git a/lib/uploader/index.wxss b/lib/uploader/index.wxss
index da44e472..b1fd9592 100644
--- a/lib/uploader/index.wxss
+++ b/lib/uploader/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#f7f8fa;border-radius:8px}.van-uploader__upload:active{background-color:#f2f3f5}.van-uploader__upload-icon{color:#dcdee0;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__upload--disabled{opacity:.5;opacity:var(--uploader-disabled-opacity,.5)}.van-uploader__preview{position:relative;margin:0 8px 8px 0;cursor:pointer}.van-uploader__preview-image{display:block;width:80px;height:80px;overflow:hidden;border-radius:8px}.van-uploader__preview-delete{position:absolute;top:-8px;right:-8px;color:#969799;font-size:18px;background-color:#fff;border-radius:100%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:8px}.van-uploader__file-icon{color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 4px;color:#646566;font-size:12px;text-align:center}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;color:#fff;background-color:rgba(50,50,51,.88);border-radius:8px}.van-uploader__mask-icon{font-size:22px}.van-uploader__mask-message{margin-top:6px;padding:0 4px;font-size:12px;line-height:14px}.van-uploader__loading{width:22px;height:22px;color:#fff}
\ No newline at end of file
+@import '../common/index.wxss';.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}.van-uploader__slot:empty{display:none}.van-uploader__slot:not(:empty)+.van-uploader__upload{display:none!important}.van-uploader__upload{position:relative;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:80px;height:80px;margin:0 8px 8px 0;background-color:#f7f8fa;border-radius:8px}.van-uploader__upload:active{background-color:#f2f3f5}.van-uploader__upload-icon{color:#dcdee0;font-size:24px}.van-uploader__upload-text{margin-top:8px;color:#969799;font-size:12px}.van-uploader__upload--disabled{opacity:.5;opacity:var(--uploader-disabled-opacity,.5)}.van-uploader__preview{position:relative;margin:0 8px 8px 0;cursor:pointer}.van-uploader__preview-image{display:block;width:80px;height:80px;overflow:hidden;border-radius:8px}.van-uploader__preview-delete{position:absolute;top:0;right:0;z-index:1;display:-webkit-flex;display:flex;padding:10px;border-radius:50%;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%)}.van-uploader__preview-delete__icon{color:#969799;font-size:18px;background-color:#fff;border-radius:50%}.van-uploader__file{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;width:80px;height:80px;background-color:#f7f8fa;border-radius:8px}.van-uploader__file-icon{color:#646566;font-size:20px}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:8px;padding:0 4px;color:#646566;font-size:12px;text-align:center}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;color:#fff;background-color:rgba(50,50,51,.88);border-radius:8px}.van-uploader__mask-icon{font-size:22px}.van-uploader__mask-message{margin-top:6px;padding:0 4px;font-size:12px;line-height:14px}.van-uploader__loading{width:22px;height:22px;color:#fff}
\ No newline at end of file
From b7f4627cbdd60948b15b1f207e6ea264b9cca37f Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 24 Jun 2020 17:08:54 +0800
Subject: [PATCH 030/119] build: release 1.3.3
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 49da7961..cdf91f32 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@vant/weapp",
- "version": "1.3.2",
+ "version": "1.3.3",
"author": "youzan",
"license": "MIT",
"miniprogram": "lib",
From 11dd8df9d4aa067a0c8a005513bd6a9d1ac27421 Mon Sep 17 00:00:00 2001
From: rex
Date: Wed, 24 Jun 2020 17:34:36 +0800
Subject: [PATCH 031/119] docs(changelog): release 1.3.3
---
docs/markdown/changelog.md | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/docs/markdown/changelog.md b/docs/markdown/changelog.md
index 5a62d558..120e852c 100644
--- a/docs/markdown/changelog.md
+++ b/docs/markdown/changelog.md
@@ -1,5 +1,24 @@
# 更新日志
+### [v1.3.3](https://github.com/youzan/vant-weapp/tree/v1.3.3)
+`2020-06-24`
+
+**Features**
+
+- steps: 为每一项增加 inactiveIcon、activeIcon 属性 [\#3315](https://github.com/youzan/vant-weapp/pull/3315)
+- field: 增加外部样式类 label-class [\#3311](https://github.com/youzan/vant-weapp/pull/3311)
+- field: 现在总会从内部 set value 值 [\#3313](https://github.com/youzan/vant-weapp/pull/3313)
+- uploader: 为每一项增加 deletable 属性 [\#3270](https://github.com/youzan/vant-weapp/pull/3270)
+- uploader: 扩大删除图标的可点击区域 [\#3265](https://github.com/youzan/vant-weapp/pull/3265)
+
+**Bug Fixes**
+
+- tabbar: 修复 iphone-se 上高度异常 [\#3314](https://github.com/youzan/vant-weapp/pull/3314)
+- grid: 修复 text 与 icon 同时设置时样式异常 [\#3310](https://github.com/youzan/vant-weapp/pull/3310)
+- calendar: 修复多选模式下 default-date 属性不生效 [\#3284](https://github.com/youzan/vant-weapp/pull/3284)
+- circle: 修复 type="2d" 时无法动态变更 value [\#3264](https://github.com/youzan/vant-weapp/pull/3264)
+- nav-bar: 修复未设置 left-text 时左侧图标样式异常 [\#3263](https://github.com/youzan/vant-weapp/pull/3263)
+
### [v1.3.2](https://github.com/youzan/vant-weapp/tree/v1.3.2)
`2020-06-04`
From b4cfcceca81c90f5878a6e32c277f400845a125d Mon Sep 17 00:00:00 2001
From: neverland
Date: Wed, 24 Jun 2020 17:38:15 +0800
Subject: [PATCH 032/119] feat(Picker): update action button style (#3316)
---
packages/common/style/var.less | 5 +++--
packages/picker/index.less | 16 +++++++++++-----
packages/picker/toolbar.wxml | 2 +-
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/packages/common/style/var.less b/packages/common/style/var.less
index 88655283..a909d6ea 100644
--- a/packages/common/style/var.less
+++ b/packages/common/style/var.less
@@ -27,6 +27,7 @@
@disabled-opacity: 0.5;
@background-color: @gray-1;
@background-color-light: #fafafa;
+@text-link-color: #576b95;
// Padding
@padding-base: 4px;
@@ -328,8 +329,8 @@
@picker-title-font-size: @font-size-lg;
@picker-action-padding: 0 @padding-md;
@picker-action-font-size: @font-size-md;
-@picker-action-text-color: @blue;
-@picker-action-active-color: @active-color;
+@picker-confirm-action-color: @text-link-color;
+@picker-cancel-action-color: @gray-6;
@picker-option-font-size: @font-size-lg;
@picker-option-text-color: @black;
@picker-loading-icon-color: @blue;
diff --git a/packages/picker/index.less b/packages/picker/index.less
index a500197a..efe78241 100644
--- a/packages/picker/index.less
+++ b/packages/picker/index.less
@@ -19,13 +19,20 @@
&__confirm {
.theme(padding, '@picker-action-padding');
.theme(font-size, '@picker-action-font-size');
- .theme(color, '@picker-action-text-color');
&--hover {
- .theme(background-color, '@picker-action-active-color');
+ opacity: @active-opacity;
}
}
+ &__confirm {
+ .theme(color, '@picker-confirm-action-color');
+ }
+
+ &__cancel {
+ .theme(color, '@picker-cancel-action-color');
+ }
+
&__title {
max-width: 50%;
text-align: center;
@@ -75,13 +82,12 @@
pointer-events: none;
}
- &__loading .van-loading,
&__frame {
position: absolute;
top: 50%;
- left: 0;
+ right: @padding-md;
+ left: @padding-md;
z-index: 1;
- width: 100%;
transform: translateY(-50%);
pointer-events: none;
}
diff --git a/packages/picker/toolbar.wxml b/packages/picker/toolbar.wxml
index 4fa9db50..e41a7301 100644
--- a/packages/picker/toolbar.wxml
+++ b/packages/picker/toolbar.wxml
@@ -1,7 +1,7 @@
Date: Wed, 24 Jun 2020 17:55:42 +0800
Subject: [PATCH 033/119] fix(Uploader): incorrect default size and loading
style (#3317)
---
packages/uploader/index.less | 2 +-
packages/uploader/index.ts | 6 ++----
packages/uploader/index.wxml | 4 ++--
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/packages/uploader/index.less b/packages/uploader/index.less
index 8c6c3db0..8a5981c1 100644
--- a/packages/uploader/index.less
+++ b/packages/uploader/index.less
@@ -138,6 +138,6 @@
&__loading {
width: @uploader-loading-icon-size;
height: @uploader-loading-icon-size;
- color: @uploader-loading-icon-color;
+ color: @uploader-loading-icon-color !important;
}
}
diff --git a/packages/uploader/index.ts b/packages/uploader/index.ts
index 412c6c62..3de1330d 100644
--- a/packages/uploader/index.ts
+++ b/packages/uploader/index.ts
@@ -12,7 +12,7 @@ VantComponent({
beforeRead: null,
previewSize: {
type: null,
- value: 90,
+ value: 80,
},
name: {
type: [Number, String],
@@ -78,9 +78,7 @@ VantComponent({
? isImageFile(item)
: item.isImage,
deletable:
- typeof item.deletable === 'undefined'
- ? true
- : item.deletable,
+ typeof item.deletable === 'undefined' ? true : item.deletable,
}));
this.setData({ lists, isInCount: lists.length < maxCount });
},
diff --git a/packages/uploader/index.wxml b/packages/uploader/index.wxml
index bce0a495..efec32e0 100644
--- a/packages/uploader/index.wxml
+++ b/packages/uploader/index.wxml
@@ -34,8 +34,8 @@
class="van-uploader__mask"
>
-
- {{ item.message }}
+
+ {{ item.message }}
Date: Mon, 29 Jun 2020 11:06:01 +0800
Subject: [PATCH 034/119] docs: fix job link (#3329)
---
README.md | 2 +-
docs/markdown/intro.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index ae024c9f..848e2f82 100644
--- a/README.md
+++ b/README.md
@@ -111,7 +111,7 @@ Vant Weapp 最低支持到小程序基础库 1.9.9 版本
我们正在寻找更多优秀的小伙伴,一起拓展前端技术的边界,期待你的加入!
-- 职位详情(Base: 杭州/深圳)
+- 职位详情(Base: 杭州/深圳)
- 团队博客
- 开源项目
diff --git a/docs/markdown/intro.md b/docs/markdown/intro.md
index 288255ae..474955b0 100644
--- a/docs/markdown/intro.md
+++ b/docs/markdown/intro.md
@@ -34,7 +34,7 @@ Vant Weapp 是移动端 Vue 组件库 [Vant](https://github.com/youzan/vant) 的
我们正在寻找更多优秀的小伙伴,一起拓展前端技术的边界,期待你的加入!
-- 职位详情(Base: 杭州/深圳)
+- 职位详情(Base: 杭州/深圳)
- 团队博客
- 开源项目
From 3a60055f8e5065a81d417794c181ff25573c88bd Mon Sep 17 00:00:00 2001
From: DFmoon <1375709980@qq.com>
Date: Tue, 30 Jun 2020 11:43:37 +0800
Subject: [PATCH 035/119] feat(Empty): add Empty component (#3327)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat(Empty): add Empty component
* fix: 支持传入自定义图片链接
Co-authored-by: shendongfeng
---
example/app.json | 2 +
example/config.js | 126 +++++++++++++++++----------------
example/pages/empty/index.js | 13 ++++
example/pages/empty/index.json | 3 +
example/pages/empty/index.wxml | 36 ++++++++++
example/pages/empty/index.wxss | 10 +++
example/project.config.json | 12 +++-
packages/common/style/var.less | 10 +++
packages/empty/README.md | 90 +++++++++++++++++++++++
packages/empty/index.json | 4 ++
packages/empty/index.less | 33 +++++++++
packages/empty/index.ts | 22 ++++++
packages/empty/index.wxml | 15 ++++
13 files changed, 314 insertions(+), 62 deletions(-)
create mode 100644 example/pages/empty/index.js
create mode 100644 example/pages/empty/index.json
create mode 100644 example/pages/empty/index.wxml
create mode 100644 example/pages/empty/index.wxss
create mode 100644 packages/empty/README.md
create mode 100644 packages/empty/index.json
create mode 100644 packages/empty/index.less
create mode 100644 packages/empty/index.ts
create mode 100644 packages/empty/index.wxml
diff --git a/example/app.json b/example/app.json
index c507c92e..8e43a2ce 100644
--- a/example/app.json
+++ b/example/app.json
@@ -49,6 +49,7 @@
"pages/index-bar/index",
"pages/skeleton/index",
"pages/divider/index",
+ "pages/empty/index",
"pages/calendar/index"
],
"window": {
@@ -72,6 +73,7 @@
"van-count-down": "./dist/count-down/index",
"van-dialog": "./dist/dialog/index",
"van-divider": "./dist/divider/index",
+ "van-empty": "./dist/empty/index",
"van-field": "./dist/field/index",
"van-goods-action": "./dist/goods-action/index",
"van-goods-action-icon": "./dist/goods-action-icon/index",
diff --git a/example/config.js b/example/config.js
index c92b3448..cd571154 100644
--- a/example/config.js
+++ b/example/config.js
@@ -5,33 +5,33 @@ export default [
list: [
{
path: '/button',
- title: 'Button 按钮'
+ title: 'Button 按钮',
},
{
path: '/cell',
- title: 'Cell 单元格'
+ title: 'Cell 单元格',
},
{
path: '/icon',
- title: 'Icon 图标'
+ title: 'Icon 图标',
},
{
path: '/image',
- title: 'Image 图片'
+ title: 'Image 图片',
},
{
path: '/col',
- title: 'Layout 布局'
+ title: 'Layout 布局',
},
{
path: '/popup',
- title: 'Popup 弹出层'
+ title: 'Popup 弹出层',
},
{
path: '/transition',
- title: 'Transition 动画'
- }
- ]
+ title: 'Transition 动画',
+ },
+ ],
},
{
groupName: '表单组件',
@@ -43,49 +43,49 @@ export default [
},
{
path: '/checkbox',
- title: 'Checkbox 复选框'
+ title: 'Checkbox 复选框',
},
{
path: '/datetime-picker',
- title: 'DatetimePicker 时间选择'
+ title: 'DatetimePicker 时间选择',
},
{
path: '/field',
- title: 'Field 输入框'
+ title: 'Field 输入框',
},
{
path: '/picker',
- title: 'Picker 选择器'
+ title: 'Picker 选择器',
},
{
path: '/radio',
- title: 'Radio 单选框'
+ title: 'Radio 单选框',
},
{
path: '/rate',
- title: 'Rate 评分'
+ title: 'Rate 评分',
},
{
path: '/search',
- title: 'Search 搜索'
+ title: 'Search 搜索',
},
{
path: '/slider',
- title: 'Slider 滑块'
+ title: 'Slider 滑块',
},
{
path: '/stepper',
- title: 'Stepper 步进器'
+ title: 'Stepper 步进器',
},
{
path: '/switch',
- title: 'Switch 开关'
+ title: 'Switch 开关',
},
{
path: '/uploader',
- title: 'Uploader 文件上传'
- }
- ]
+ title: 'Uploader 文件上传',
+ },
+ ],
},
{
groupName: '反馈组件',
@@ -93,37 +93,37 @@ export default [
list: [
{
path: '/action-sheet',
- title: 'ActionSheet 上拉菜单'
+ title: 'ActionSheet 上拉菜单',
},
{
path: '/dialog',
- title: 'Dialog 弹出框'
+ title: 'Dialog 弹出框',
},
{
path: '/dropdown-menu',
- title: 'DropdownMenu 下拉菜单'
+ title: 'DropdownMenu 下拉菜单',
},
{
path: '/loading',
- title: 'Loading 加载'
+ title: 'Loading 加载',
},
{
path: '/notify',
- title: 'Notify 消息通知'
+ title: 'Notify 消息通知',
},
{
path: '/overlay',
- title: 'Overlay 遮罩层'
+ title: 'Overlay 遮罩层',
},
{
path: '/swipe-cell',
- title: 'SwipeCell 滑动单元格'
+ title: 'SwipeCell 滑动单元格',
},
{
path: '/toast',
- title: 'Toast 轻提示'
- }
- ]
+ title: 'Toast 轻提示',
+ },
+ ],
},
{
groupName: '展示组件',
@@ -131,53 +131,57 @@ export default [
list: [
{
path: '/circle',
- title: 'Circle 进度条'
+ title: 'Circle 进度条',
},
{
path: '/collapse',
- title: 'Collapse 折叠面板'
+ title: 'Collapse 折叠面板',
},
{
path: '/count-down',
- title: 'CountDown 倒计时'
+ title: 'CountDown 倒计时',
},
{
path: '/divider',
- title: 'Divider 分割线'
+ title: 'Divider 分割线',
+ },
+ {
+ path: '/empty',
+ title: 'Empty 空状态',
},
{
path: '/notice-bar',
- title: 'NoticeBar 通告栏'
+ title: 'NoticeBar 通告栏',
},
{
path: '/panel',
- title: 'Panel 面板'
+ title: 'Panel 面板',
},
{
path: '/progress',
- title: 'Progress 进度条'
+ title: 'Progress 进度条',
},
{
path: '/skeleton',
- title: 'Skeleton 骨架屏'
+ title: 'Skeleton 骨架屏',
},
{
path: '/steps',
- title: 'Steps 步骤条'
+ title: 'Steps 步骤条',
},
{
path: '/sticky',
- title: 'Sticky 粘性布局'
+ title: 'Sticky 粘性布局',
},
{
path: '/tag',
- title: 'Tag 标记'
+ title: 'Tag 标记',
},
{
path: '/tree-select',
- title: 'TreeSelect 分类选择'
- }
- ]
+ title: 'TreeSelect 分类选择',
+ },
+ ],
},
{
groupName: '导航组件',
@@ -185,29 +189,29 @@ export default [
list: [
{
path: '/grid',
- title: 'Grid 宫格'
+ title: 'Grid 宫格',
},
{
path: '/index-bar',
- title: 'IndexBar 索引栏'
+ title: 'IndexBar 索引栏',
},
{
path: '/sidebar',
- title: 'Sidebar 侧边导航'
+ title: 'Sidebar 侧边导航',
},
{
path: '/nav-bar',
- title: 'NavBar 导航栏'
+ title: 'NavBar 导航栏',
},
{
path: '/tab',
- title: 'Tab 标签页'
+ title: 'Tab 标签页',
},
{
path: '/tabbar',
- title: 'Tabbar 标签栏'
- }
- ]
+ title: 'Tabbar 标签栏',
+ },
+ ],
},
{
groupName: '业务组件',
@@ -215,20 +219,20 @@ export default [
list: [
{
path: '/area',
- title: 'Area 省市区选择'
+ title: 'Area 省市区选择',
},
{
path: '/card',
- title: 'Card 商品卡片'
+ title: 'Card 商品卡片',
},
{
path: '/submit-bar',
- title: 'SubmitBar 提交订单栏'
+ title: 'SubmitBar 提交订单栏',
},
{
path: '/goods-action',
- title: 'GoodsAction 商品导航'
- }
- ]
- }
+ title: 'GoodsAction 商品导航',
+ },
+ ],
+ },
];
diff --git a/example/pages/empty/index.js b/example/pages/empty/index.js
new file mode 100644
index 00000000..d0a25c57
--- /dev/null
+++ b/example/pages/empty/index.js
@@ -0,0 +1,13 @@
+import Page from '../../common/page';
+
+Page({
+ data: {
+ activeTab: 0,
+ },
+
+ onChange(event) {
+ this.setData({
+ activeTab: event.detail.name,
+ });
+ },
+});
diff --git a/example/pages/empty/index.json b/example/pages/empty/index.json
new file mode 100644
index 00000000..76a301f4
--- /dev/null
+++ b/example/pages/empty/index.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "Empty 空状态"
+}
diff --git a/example/pages/empty/index.wxml b/example/pages/empty/index.wxml
new file mode 100644
index 00000000..a661b534
--- /dev/null
+++ b/example/pages/empty/index.wxml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 按钮
+
+
+
\ No newline at end of file
diff --git a/example/pages/empty/index.wxss b/example/pages/empty/index.wxss
new file mode 100644
index 00000000..da81592c
--- /dev/null
+++ b/example/pages/empty/index.wxss
@@ -0,0 +1,10 @@
+
+.custom-image .van-empty__image {
+ width: 90px;
+ height: 90px;
+}
+
+.bottom-button {
+ width: 160px;
+ height: 40px;
+}
\ No newline at end of file
diff --git a/example/project.config.json b/example/project.config.json
index 5f82a265..e6fd2153 100644
--- a/example/project.config.json
+++ b/example/project.config.json
@@ -6,6 +6,7 @@
"setting": {
"urlCheck": false,
"es6": true,
+ "enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
@@ -15,15 +16,18 @@
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
+ "uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
+ "compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
- "useCompilerModule": true,
+ "useIsolateContext": true,
+ "useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
@@ -371,6 +375,12 @@
"name": "index-bar",
"pathName": "pages/index-bar/index",
"scene": null
+ },
+ {
+ "id": -1,
+ "name": "empty",
+ "pathName": "pages/empty/index",
+ "scene": null
}
]
}
diff --git a/packages/common/style/var.less b/packages/common/style/var.less
index a909d6ea..03dfe94e 100644
--- a/packages/common/style/var.less
+++ b/packages/common/style/var.less
@@ -546,6 +546,16 @@
@divider-content-left-width: 10%;
@divider-content-right-width: 10%;
+// Empty
+@empty-padding: @padding-xl 0;
+@empty-image-size: 160px;
+@empty-description-margin-top: @padding-md;
+@empty-description-padding: 0 60px;
+@empty-description-color: @gray-6;
+@empty-description-font-size: 14px;
+@empty-description-line-height: 20px;
+@empty-bottom-margin-top: 24px;
+
// TreeSelect
@tree-select-font-size: @font-size-md;
@tree-select-nav-background-color: @background-color;
diff --git a/packages/empty/README.md b/packages/empty/README.md
new file mode 100644
index 00000000..56eb1844
--- /dev/null
+++ b/packages/empty/README.md
@@ -0,0 +1,90 @@
+# Empty 空状态
+
+### 介绍
+
+空状态时的占位提示
+
+### 引入
+
+```js
+import Vue from 'vue';
+import { Empty } from 'vant';
+
+Vue.use(Empty);
+```
+
+## 代码演示
+
+### 基础用法
+
+```html
+
+```
+
+### 图片类型
+
+Empty 组件内置了多种占位图片类型,可以在不同业务场景下使用
+
+```html
+
+
+
+
+
+
+```
+
+### 自定义图片
+
+需要自定义图片时,可以在 image 属性中传入任意图片 URL
+
+```html
+
+
+
+```
+
+### 底部内容
+
+通过默认插槽可以在 Empty 组件的下方插入内容
+
+```html
+
+
+ 按钮
+
+
+
+
+```
+
+## API
+
+### Props
+
+| 参数 | 说明 | 类型 | 默认值 |
+| --- | --- | --- | --- |
+| image | 图片类型,可选值为 `error` `network` `search`,支持传入图片 URL | _string_ | `default` |
+| description | 图片下方的描述文字 | _string_ | - |
+
+### Slots
+
+| 名称 | 说明 |
+| ----------- | -------------- |
+| default | 自定义底部内容 |
+| image | 自定义图标 |
+| description | 自定义描述文字 |
diff --git a/packages/empty/index.json b/packages/empty/index.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/packages/empty/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/packages/empty/index.less b/packages/empty/index.less
new file mode 100644
index 00000000..810b7ee0
--- /dev/null
+++ b/packages/empty/index.less
@@ -0,0 +1,33 @@
+@import '../common/style/var.less';
+@import '../common/style/theme.less';
+
+.van-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ padding: @empty-padding;
+
+ &__image {
+ width: @empty-image-size;
+ height: @empty-image-size;
+
+ &__img {
+ width: 100%;
+ height: 100%;
+ }
+ }
+
+ &__description {
+ margin-top: @empty-description-margin-top;
+ padding: @empty-description-padding;
+ color: @empty-description-color;
+ font-size: @empty-description-font-size;
+ line-height: @empty-description-line-height;
+ }
+
+ &__bottom {
+ margin-top: @empty-bottom-margin-top;
+ }
+}
diff --git a/packages/empty/index.ts b/packages/empty/index.ts
new file mode 100644
index 00000000..044faba9
--- /dev/null
+++ b/packages/empty/index.ts
@@ -0,0 +1,22 @@
+import { VantComponent } from '../common/component';
+
+const PRESETS = ['error', 'search', 'default', 'network'];
+
+VantComponent({
+ props: {
+ description: String,
+ image: {
+ type: String,
+ value: 'default',
+ },
+ },
+ created() {
+ if (PRESETS.indexOf(this.data.image) !== -1) {
+ this.setData({
+ imageUrl: `https://img.yzcdn.cn/vant/empty-image-${this.data.image}.png`,
+ });
+ } else {
+ this.setData({ imageUrl: this.data.image });
+ }
+ },
+});
diff --git a/packages/empty/index.wxml b/packages/empty/index.wxml
new file mode 100644
index 00000000..1c284697
--- /dev/null
+++ b/packages/empty/index.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ {{ description }}
+
+
+
+
+
\ No newline at end of file
From 44194c711eb884c2767a66d42e40bed938c2a1ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wuli=E9=94=A4=E9=94=A4?= <980198595@qq.com>
Date: Wed, 8 Jul 2020 15:43:01 +0800
Subject: [PATCH 036/119] fix(Area): When setting the attribute [columns-num=1
or columns-num=2] lower than the WeChat basic library version 2.7.7, the real
machine environment reports an error (#3318)
---
packages/area/index.ts | 43 ++++++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/packages/area/index.ts b/packages/area/index.ts
index c2c9a21a..e647570a 100644
--- a/packages/area/index.ts
+++ b/packages/area/index.ts
@@ -201,31 +201,34 @@ VantComponent({
}
const stack = [];
+ const indexes = [];
- stack.push(picker.setColumnValues(0, province, false));
- stack.push(picker.setColumnValues(1, city, false));
-
- if (city.length && code.slice(2, 4) === '00') {
- [{ code }] = city;
+ if (this.data.columnsNum >= 1) {
+ stack.push(picker.setColumnValues(0, province, false));
+ indexes.push(this.getIndex('province', code));
}
- stack.push(
- picker.setColumnValues(
- 2,
- this.getList('county', code.slice(0, 4)),
- false
- )
- );
+ if (this.data.columnsNum >= 2) {
+ stack.push(picker.setColumnValues(1, city, false));
+ indexes.push(this.getIndex('province', code));
+ if (city.length && code.slice(2, 4) === '00') {
+ [{ code }] = city;
+ }
+ }
+
+ if (this.data.columnsNum === 3) {
+ stack.push(
+ picker.setColumnValues(
+ 2,
+ this.getList('county', code.slice(0, 4)),
+ false
+ )
+ );
+ }
return Promise.all(stack)
.catch(() => {})
- .then(() =>
- picker.setIndexes([
- this.getIndex('province', code),
- this.getIndex('city', code),
- this.getIndex('county', code),
- ])
- )
+ .then(() => picker.setIndexes(indexes))
.catch(() => {});
},
@@ -267,4 +270,4 @@ VantComponent({
return this.setValues();
},
},
-});
+});
\ No newline at end of file
From fa54a19805722b818569c6eeb3cc2b2313272202 Mon Sep 17 00:00:00 2001
From: rex
Date: Thu, 9 Jul 2020 14:15:02 +0800
Subject: [PATCH 037/119] fix(datetime-picker): update value with origin column
after change (#3352)
---
packages/datetime-picker/index.ts | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/packages/datetime-picker/index.ts b/packages/datetime-picker/index.ts
index c638defb..190cc6f9 100644
--- a/packages/datetime-picker/index.ts
+++ b/packages/datetime-picker/index.ts
@@ -103,7 +103,7 @@ VantComponent({
methods: {
updateValue() {
const { data } = this;
- const val = this.correctValue(this.data.value);
+ const val = this.correctValue(data.value);
const isEqual = val === data.innerValue;
if (!isEqual) {
this.updateColumnValue(val).then(() => {
@@ -291,13 +291,17 @@ VantComponent({
let value;
const picker = this.getPicker();
+ const originColumns = this.getOriginColumns();
if (data.type === 'time') {
const indexes = picker.getIndexes();
- value = `${+data.columns[0].values[indexes[0]]}:${+data.columns[1]
+ value = `${+originColumns[0].values[indexes[0]]}:${+originColumns[1]
.values[indexes[1]]}`;
} else {
- const values = picker.getValues();
+ const indexes = picker.getIndexes();
+ const values = indexes.map(
+ (value, index) => originColumns[index].values[value]
+ );
const year = getTrueValue(values[0]);
const month = getTrueValue(values[1]);
const maxDate = getMonthEndDay(year, month);
@@ -324,7 +328,8 @@ VantComponent({
updateColumnValue(value) {
let values = [];
- const { type, formatter = defaultFormatter } = this.data;
+ const { type } = this.data;
+ const formatter = this.data.formatter || defaultFormatter;
const picker = this.getPicker();
if (type === 'time') {
From da4a5f3cd4f86efeafc4bef4f902e2ecd6f9e768 Mon Sep 17 00:00:00 2001
From: neverland
Date: Thu, 9 Jul 2020 15:30:40 +0800
Subject: [PATCH 038/119] feat(Field): update label style (#3357)
---
packages/common/style/var.less | 2 ++
packages/field/README.md | 2 +-
packages/field/index.less | 5 +++++
packages/field/index.ts | 18 +++++++++---------
packages/field/index.wxml | 6 ++++--
5 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/packages/common/style/var.less b/packages/common/style/var.less
index 03dfe94e..8b483fb8 100644
--- a/packages/common/style/var.less
+++ b/packages/common/style/var.less
@@ -234,6 +234,8 @@
@dialog-has-title-message-padding-top: @padding-sm;
// Field
+@field-label-color: @gray-7;
+@field-label-margin-right: @padding-sm;
@field-input-text-color: @text-color;
@field-input-error-text-color: @red;
@field-input-disabled-text-color: @gray-6;
diff --git a/packages/field/README.md b/packages/field/README.md
index b9aeaae7..ab7d5233 100644
--- a/packages/field/README.md
+++ b/packages/field/README.md
@@ -206,7 +206,7 @@ Page({
| clickable | 是否开启点击反馈 | _boolean_ | `false` |
| required | 是否显示表单必填星号 | _boolean_ | `false` |
| password | 是否是密码类型 | _boolean_ | `false` |
-| title-width | 标题宽度 | _string_ | `90px` |
+| title-width | 标题宽度 | _string_ | `6.2em` |
| maxlength | 最大输入长度,设置为 -1 的时候不限制最大长度 | _number_ | `-1` |
| placeholder | 输入框为空时占位符 | _string_ | - |
| placeholder-style | 指定 placeholder 的样式 | _string_ | - |
diff --git a/packages/field/index.less b/packages/field/index.less
index e56565ac..863fe07e 100644
--- a/packages/field/index.less
+++ b/packages/field/index.less
@@ -4,6 +4,11 @@
.van-field {
.theme(--cell-icon-size, '@field-icon-size');
+ &__label {
+ .theme(color, '@field-label-color');
+ .theme(margin-right, '@field-label-margin-right');
+ }
+
&__body {
display: flex;
align-items: center;
diff --git a/packages/field/index.ts b/packages/field/index.ts
index c4123e8c..9ecc3975 100644
--- a/packages/field/index.ts
+++ b/packages/field/index.ts
@@ -20,16 +20,8 @@ VantComponent({
leftIcon: String,
rightIcon: String,
autosize: [Boolean, Object],
- readonly: {
- type: Boolean,
- observer: 'setShowClear',
- },
required: Boolean,
iconClass: String,
- clearable: {
- type: Boolean,
- observer: 'setShowClear',
- },
clickable: Boolean,
inputAlign: String,
customStyle: String,
@@ -37,13 +29,21 @@ VantComponent({
arrowDirection: String,
showWordLimit: Boolean,
errorMessageAlign: String,
+ readonly: {
+ type: Boolean,
+ observer: 'setShowClear',
+ },
+ clearable: {
+ type: Boolean,
+ observer: 'setShowClear',
+ },
border: {
type: Boolean,
value: true,
},
titleWidth: {
type: String,
- value: '90px',
+ value: '6.2em',
},
},
diff --git a/packages/field/index.wxml b/packages/field/index.wxml
index c984d897..41102af7 100644
--- a/packages/field/index.wxml
+++ b/packages/field/index.wxml
@@ -4,7 +4,6 @@
-
+
+ {{ label }}
+
+
Date: Fri, 17 Jul 2020 16:33:15 +0800
Subject: [PATCH 060/119] build: release 1.4.0
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index aa10ad4c..a95d5334 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@vant/weapp",
- "version": "1.4.0-beta.3",
+ "version": "1.4.0",
"author": "youzan",
"license": "MIT",
"miniprogram": "lib",
From ed8b8373b5387118f085882603de881d9719dbbd Mon Sep 17 00:00:00 2001
From: rex
Date: Sat, 18 Jul 2020 21:19:20 +0800
Subject: [PATCH 061/119] docs(changelog): release 1.4.0
---
docs/markdown/changelog.md | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/docs/markdown/changelog.md b/docs/markdown/changelog.md
index 120e852c..30a2dedb 100644
--- a/docs/markdown/changelog.md
+++ b/docs/markdown/changelog.md
@@ -1,5 +1,34 @@
# 更新日志
+### [v1.4.0](https://github.com/youzan/vant-weapp/tree/v1.4.0)
+`2020-07-17`
+
+**Features**
+
+- Empty: 新增 Empty 组件 [\#3327](https://github.com/youzan/vant-weapp/pull/3327)
+- NoticeBar: 新增 background 属性 [\#3388](https://github.com/youzan/vant-weapp/pull/3388)
+- NoticeBar: 新增 close 事件 [\#3388](https://github.com/youzan/vant-weapp/pull/3388)
+- GridItem: 新增 icon-color 属性 [\#3386](https://github.com/youzan/vant-weapp/pull/3386)
+- NavBar: 现在 custom-style 将影响根节点[\#3371](https://github.com/youzan/vant-weapp/pull/3371)
+- Cell: 新增 title-style 属性, fix Field label width [\#3370](https://github.com/youzan/vant-weapp/pull/3370)
+- Uploader: 更新 failed 图标 [\#3359](https://github.com/youzan/vant-weapp/pull/3359)
+- Uploader: 更新删除图标样式 [\#3385](https://github.com/youzan/vant-weapp/pull/3385)
+- Uploader: 移除圆角样式 [\#3384](https://github.com/youzan/vant-weapp/pull/3384)
+- Field: 更新禁用态样式 [\#3358](https://github.com/youzan/vant-weapp/pull/3358)
+- Field: 更新 label 样式 [\#3357](https://github.com/youzan/vant-weapp/pull/3357)
+- Picker: 调整 action button 样式 [\#3316](https://github.com/youzan/vant-weapp/pull/3316)
+
+**Bug Fixes**
+
+- Collapse: 使用 animation 重构动画部分逻辑以修复动画卡顿 [\#3401](https://github.com/youzan/vant-weapp/pull/3401)
+- Uploader: 修复 loading 样式错误、调整 previewSize 属性默认值 [\#3317](https://github.com/youzan/vant-weapp/pull/3317)
+- Area: 修复低版本基础库下 columns-num 设置为 1 或 2 时真机环境报错 [\#3318](https://github.com/youzan/vant-weapp/pull/3318)
+- DatetimePicker: 修复使用 formatter 时,事件返回值可能不正确 [\#3352](https://github.com/youzan/vant-weapp/pull/3352)
+- Field: 修复 textarea 模式下 label 与 value 不在同一水平线上 [\#3383](https://github.com/youzan/vant-weapp/pull/3383)
+- Dialog: show dialog after class ready [\#3374](https://github.com/youzan/vant-weapp/pull/3374)
+- Calendar: confirm-disabled-text 属性增加默认值 [\#3394](https://github.com/youzan/vant-weapp/pull/3394)
+
+
### [v1.3.3](https://github.com/youzan/vant-weapp/tree/v1.3.3)
`2020-06-24`
From 2855aa91d90f333a00dcdb8e8a362fabe723a171 Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 21 Jul 2020 09:43:15 +0800
Subject: [PATCH 062/119] docs(field): add example for two way binding (#3414)
fix #3341
---
packages/field/README.md | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/packages/field/README.md b/packages/field/README.md
index ab7d5233..9d237898 100644
--- a/packages/field/README.md
+++ b/packages/field/README.md
@@ -42,6 +42,28 @@ Page({
});
```
+### 双向绑定
+
+最低基础库版本在 2.9.3 以上时,可以使用[简易双向绑定](https://developers.weixin.qq.com/miniprogram/dev/framework/view/two-way-bindings.html)
+
+```html
+
+
+
+```
+
+```js
+Page({
+ data: {
+ value: '',
+ },
+});
+```
+
### 自定义类型
根据`type`属性定义不同类型的输入框
From cfbf07bb8a101470dba791c56005a87b6b8a96ab Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 21 Jul 2020 11:05:43 +0800
Subject: [PATCH 063/119] fix(slider): avoid emit drag on click (#3415)
fix #3378
---
packages/slider/index.ts | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/packages/slider/index.ts b/packages/slider/index.ts
index e06acdda..f4bcebaa 100644
--- a/packages/slider/index.ts
+++ b/packages/slider/index.ts
@@ -13,25 +13,29 @@ VantComponent({
inactiveColor: String,
max: {
type: Number,
- value: 100,
+ value: 100
},
min: {
type: Number,
- value: 0,
+ value: 0
},
step: {
type: Number,
- value: 1,
+ value: 1
},
value: {
type: Number,
value: 0,
- observer: 'updateValue',
+ observer(val) {
+ if (val !== this.value) {
+ this.updateValue(val);
+ }
+ }
},
barHeight: {
type: null,
- value: '2px',
- },
+ value: 2
+ }
},
created() {
@@ -43,7 +47,7 @@ VantComponent({
if (this.data.disabled) return;
this.touchStart(event);
- this.startValue = this.format(this.data.value);
+ this.startValue = this.format(this.value);
this.dragStatus = 'start';
},
@@ -94,12 +98,13 @@ VantComponent({
const { min } = this.data;
const width = `${((value - min) * 100) / this.getRange()}%`;
+ this.value = value;
+
this.setData({
- value,
barStyle: `
width: ${width};
${drag ? 'transition: none;' : ''}
- `,
+ `
});
if (drag) {
@@ -123,6 +128,6 @@ VantComponent({
format(value: number) {
const { max, min, step } = this.data;
return Math.round(Math.max(min, Math.min(value, max)) / step) * step;
- },
- },
+ }
+ }
});
From 40072f6d4c2fd4374a3cccd220220f36300b401c Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 21 Jul 2020 11:13:05 +0800
Subject: [PATCH 064/119] docs(calendar): add doc for min-date & max-date
(#3416)
fix #3096
---
packages/calendar/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/calendar/README.md b/packages/calendar/README.md
index 44bf73e5..b6290e44 100644
--- a/packages/calendar/README.md
+++ b/packages/calendar/README.md
@@ -142,7 +142,7 @@ Page({
### 自定义日期范围
-通过`min-date`和`max-date`定义日历的范围
+通过`min-date`和`max-date`定义日历的范围,需要注意的是`min-date`和`max-date`的区间不宜过大,否则会造成严重的性能问题。
```html
Date: Tue, 21 Jul 2020 14:16:10 +0800
Subject: [PATCH 065/119] feat(Picker): adjust default value of
visible-item-count to 6 (#3418)
---
packages/area/README.md | 2 +-
packages/datetime-picker/README.md | 2 +-
packages/picker/README.md | 2 +-
packages/picker/shared.ts | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/packages/area/README.md b/packages/area/README.md
index 4935de29..5e6efab8 100644
--- a/packages/area/README.md
+++ b/packages/area/README.md
@@ -91,7 +91,7 @@ db.collection('region')
| columns-placeholder | 列占位提示文字 | _string[]_ | `[]` | - |
| loading | 是否显示加载状态 | _boolean_ | `false` | - |
| item-height | 选项高度 | _number_ | `44` | - |
-| visible-item-count | 可见的选项个数 | _number_ | `5` | - |
+| visible-item-count | 可见的选项个数 | _number_ | `6` | - |
| confirm-button-text | 确认按钮文字 | _string_ | `确认` | - |
| cancel-button-text | 取消按钮文字 | _string_ | `取消` | - |
diff --git a/packages/datetime-picker/README.md b/packages/datetime-picker/README.md
index 5e7a03db..a1a88225 100644
--- a/packages/datetime-picker/README.md
+++ b/packages/datetime-picker/README.md
@@ -192,7 +192,7 @@ Page({
| item-height | 选项高度 | _number_ | `44` | - |
| confirm-button-text | 确认按钮文字 | _string_ | `确认` | - |
| cancel-button-text | 取消按钮文字 | _string_ | `取消` | - |
-| visible-item-count | 可见的选项个数 | _number_ | `5` | - |
+| visible-item-count | 可见的选项个数 | _number_ | `6` | - |
### Events
diff --git a/packages/picker/README.md b/packages/picker/README.md
index 317aa5bd..47333d0e 100644
--- a/packages/picker/README.md
+++ b/packages/picker/README.md
@@ -157,7 +157,7 @@ Page({
| item-height | 选项高度 | _number_ | `44` | - |
| confirm-button-text | 确认按钮文字 | _string_ | `确认` | - |
| cancel-button-text | 取消按钮文字 | _string_ | `取消` | - |
-| visible-item-count | 可见的选项个数 | _number_ | `5` | - |
+| visible-item-count | 可见的选项个数 | _number_ | `6` | - |
| default-index | 单列选择器的默认选中项索引,
多列选择器请参考下方的 Columns 配置 | _number_ | `0` | - |
### Events
diff --git a/packages/picker/shared.ts b/packages/picker/shared.ts
index a8c96a8b..8531290b 100644
--- a/packages/picker/shared.ts
+++ b/packages/picker/shared.ts
@@ -12,7 +12,7 @@ export const pickerProps = {
},
visibleItemCount: {
type: Number,
- value: 5,
+ value: 6,
},
itemHeight: {
type: Number,
From aefad39a3692358dfae85aa99cb0d7e0b46bf552 Mon Sep 17 00:00:00 2001
From: neverland
Date: Tue, 21 Jul 2020 14:16:40 +0800
Subject: [PATCH 066/119] feat(Toast): increase border radius to 8px (#3419)
---
packages/common/style/var.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/common/style/var.less b/packages/common/style/var.less
index 9f97cdb2..71ee8619 100644
--- a/packages/common/style/var.less
+++ b/packages/common/style/var.less
@@ -521,7 +521,7 @@
@toast-font-size: 14px;
@toast-text-color: @white;
@toast-line-height: 20px;
-@toast-border-radius: @border-radius-md;
+@toast-border-radius: @border-radius-lg;
@toast-background-color: rgba(@text-color, 0.88);
@toast-icon-size: 48px;
@toast-text-min-width: 96px;
From 1ad284bb56f3ec12159b89cefad0d2c56f22c188 Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 28 Jul 2020 20:35:28 +0800
Subject: [PATCH 067/119] fix(area): fix setValues error (#3443)
fix #3405
---
example/project.config.json | 10 ++++----
packages/area/index.ts | 48 +++++++++++++++++++------------------
2 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/example/project.config.json b/example/project.config.json
index e6fd2153..1078db16 100644
--- a/example/project.config.json
+++ b/example/project.config.json
@@ -6,7 +6,6 @@
"setting": {
"urlCheck": false,
"es6": true,
- "enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
@@ -16,19 +15,20 @@
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
- "uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
- "compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
- "useIsolateContext": true,
"useCompilerModule": false,
- "userConfirmedUseCompilerModuleSwitch": false
+ "userConfirmedUseCompilerModuleSwitch": false,
+ "enhance": false,
+ "uglifyFileName": false,
+ "compileHotReLoad": false,
+ "useIsolateContext": true
},
"compileType": "miniprogram",
"cloudfunctionRoot": "functions/",
diff --git a/packages/area/index.ts b/packages/area/index.ts
index e647570a..aa283433 100644
--- a/packages/area/index.ts
+++ b/packages/area/index.ts
@@ -19,21 +19,21 @@ VantComponent({
observer(value: string) {
this.code = value;
this.setValues();
- },
+ }
},
areaList: {
type: Object,
value: {},
- observer: 'setValues',
+ observer: 'setValues'
},
columnsNum: {
type: null,
value: 3,
observer(value: number) {
this.setData({
- displayColumns: this.data.columns.slice(0, +value),
+ displayColumns: this.data.columns.slice(0, +value)
});
- },
+ }
},
columnsPlaceholder: {
type: Array,
@@ -42,17 +42,17 @@ VantComponent({
typeToColumnsPlaceholder: {
province: val[0] || '',
city: val[1] || '',
- county: val[2] || '',
- },
+ county: val[2] || ''
+ }
});
- },
- },
+ }
+ }
},
data: {
columns: [{ values: [] }, { values: [] }, { values: [] }],
displayColumns: [{ values: [] }, { values: [] }, { values: [] }],
- typeToColumnsPlaceholder: {},
+ typeToColumnsPlaceholder: {}
},
mounted() {
@@ -109,7 +109,7 @@ VantComponent({
this.$emit('change', {
picker,
values: this.parseOutputValues(picker.getValues()),
- index,
+ index
});
});
},
@@ -127,9 +127,9 @@ VantComponent({
}
const list = this.getConfig(type);
- result = Object.keys(list).map((code) => ({
+ result = Object.keys(list).map(code => ({
code,
- name: list[code],
+ name: list[code]
}));
if (code) {
@@ -138,7 +138,7 @@ VantComponent({
code = '9';
}
- result = result.filter((item) => item.code.indexOf(code) === 0);
+ result = result.filter(item => item.code.indexOf(code) === 0);
}
if (typeToColumnsPlaceholder[type] && result.length) {
@@ -151,7 +151,7 @@ VantComponent({
: COLUMNSPLACEHOLDERCODE.slice(4, 6);
result.unshift({
code: `${code}${codeFill}`,
- name: typeToColumnsPlaceholder[type],
+ name: typeToColumnsPlaceholder[type]
});
}
@@ -202,21 +202,22 @@ VantComponent({
const stack = [];
const indexes = [];
+ const { columnsNum } = this.data;
- if (this.data.columnsNum >= 1) {
+ if (columnsNum >= 1) {
stack.push(picker.setColumnValues(0, province, false));
indexes.push(this.getIndex('province', code));
}
- if (this.data.columnsNum >= 2) {
+ if (columnsNum >= 2) {
stack.push(picker.setColumnValues(1, city, false));
- indexes.push(this.getIndex('province', code));
+ indexes.push(this.getIndex('city', code));
if (city.length && code.slice(2, 4) === '00') {
[{ code }] = city;
}
}
- if (this.data.columnsNum === 3) {
+ if (columnsNum === 3) {
stack.push(
picker.setColumnValues(
2,
@@ -224,6 +225,7 @@ VantComponent({
false
)
);
+ indexes.push(this.getIndex('county', code));
}
return Promise.all(stack)
@@ -234,7 +236,7 @@ VantComponent({
getValues() {
const picker = this.getPicker();
- return picker ? picker.getValues().filter((value) => !!value) : [];
+ return picker ? picker.getValues().filter(value => !!value) : [];
},
getDetail() {
@@ -244,7 +246,7 @@ VantComponent({
country: '',
province: '',
city: '',
- county: '',
+ county: ''
};
if (!values.length) {
@@ -268,6 +270,6 @@ VantComponent({
reset(code) {
this.code = code || '';
return this.setValues();
- },
- },
-});
\ No newline at end of file
+ }
+ }
+});
From 367878b19818932bfe5bb9a3de146a46e0a529d6 Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 28 Jul 2020 20:52:00 +0800
Subject: [PATCH 068/119] build: compile 1.4.1
---
.github_changelog_generator | 6 ++++++
dist/area/index.js | 10 ++++++----
dist/picker/shared.js | 2 +-
dist/slider/index.js | 12 ++++++++----
dist/toast/index.wxss | 2 +-
lib/area/index.js | 10 ++++++----
lib/picker/shared.js | 2 +-
lib/slider/index.js | 12 ++++++++----
lib/toast/index.wxss | 2 +-
package.json | 1 +
yarn.lock | 10 +++++++++-
11 files changed, 48 insertions(+), 21 deletions(-)
create mode 100644 .github_changelog_generator
diff --git a/.github_changelog_generator b/.github_changelog_generator
new file mode 100644
index 00000000..1d661433
--- /dev/null
+++ b/.github_changelog_generator
@@ -0,0 +1,6 @@
+project=vant-weapp
+user=youzan
+since-tag=v1.3.0
+token=0935f6bd6b40169f1bc45bba0782e309d4a13017
+exclude-labels=duplicate,question,invalid,wontfix
+issues=false
\ No newline at end of file
diff --git a/dist/area/index.js b/dist/area/index.js
index d77fcf8e..c6216823 100644
--- a/dist/area/index.js
+++ b/dist/area/index.js
@@ -166,18 +166,19 @@ VantComponent({
}
const stack = [];
const indexes = [];
- if (this.data.columnsNum >= 1) {
+ const { columnsNum } = this.data;
+ if (columnsNum >= 1) {
stack.push(picker.setColumnValues(0, province, false));
indexes.push(this.getIndex('province', code));
}
- if (this.data.columnsNum >= 2) {
+ if (columnsNum >= 2) {
stack.push(picker.setColumnValues(1, city, false));
- indexes.push(this.getIndex('province', code));
+ indexes.push(this.getIndex('city', code));
if (city.length && code.slice(2, 4) === '00') {
[{ code }] = city;
}
}
- if (this.data.columnsNum === 3) {
+ if (columnsNum === 3) {
stack.push(
picker.setColumnValues(
2,
@@ -185,6 +186,7 @@ VantComponent({
false
)
);
+ indexes.push(this.getIndex('county', code));
}
return Promise.all(stack)
.catch(() => {})
diff --git a/dist/picker/shared.js b/dist/picker/shared.js
index a8c96a8b..8531290b 100644
--- a/dist/picker/shared.js
+++ b/dist/picker/shared.js
@@ -12,7 +12,7 @@ export const pickerProps = {
},
visibleItemCount: {
type: Number,
- value: 5,
+ value: 6,
},
itemHeight: {
type: Number,
diff --git a/dist/slider/index.js b/dist/slider/index.js
index 73c62a7f..97432920 100644
--- a/dist/slider/index.js
+++ b/dist/slider/index.js
@@ -23,11 +23,15 @@ VantComponent({
value: {
type: Number,
value: 0,
- observer: 'updateValue',
+ observer(val) {
+ if (val !== this.value) {
+ this.updateValue(val);
+ }
+ },
},
barHeight: {
type: null,
- value: '2px',
+ value: 2,
},
},
created() {
@@ -37,7 +41,7 @@ VantComponent({
onTouchStart(event) {
if (this.data.disabled) return;
this.touchStart(event);
- this.startValue = this.format(this.data.value);
+ this.startValue = this.format(this.value);
this.dragStatus = 'start';
},
onTouchMove(event) {
@@ -73,8 +77,8 @@ VantComponent({
value = this.format(value);
const { min } = this.data;
const width = `${((value - min) * 100) / this.getRange()}%`;
+ this.value = value;
this.setData({
- value,
barStyle: `
width: ${width};
${drag ? 'transition: none;' : ''}
diff --git a/dist/toast/index.wxss b/dist/toast/index.wxss
index da946c9b..2a98d2e2 100644
--- a/dist/toast/index.wxss
+++ b/dist/toast/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(50,50,51,.88);background-color:var(--toast-background-color,rgba(50,50,51,.88));border-radius:4px;border-radius:var(--toast-border-radius,4px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:90px;width:var(--toast-default-width,90px);min-height:90px;min-height:var(--toast-default-min-height,90px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:48px;font-size:var(--toast-icon-size,48px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
+@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(50,50,51,.88);background-color:var(--toast-background-color,rgba(50,50,51,.88));border-radius:8px;border-radius:var(--toast-border-radius,8px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:90px;width:var(--toast-default-width,90px);min-height:90px;min-height:var(--toast-default-min-height,90px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:48px;font-size:var(--toast-icon-size,48px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
diff --git a/lib/area/index.js b/lib/area/index.js
index 4f158fbb..d02aa154 100644
--- a/lib/area/index.js
+++ b/lib/area/index.js
@@ -192,18 +192,19 @@ component_1.VantComponent({
}
var stack = [];
var indexes = [];
- if (this.data.columnsNum >= 1) {
+ var columnsNum = this.data.columnsNum;
+ if (columnsNum >= 1) {
stack.push(picker.setColumnValues(0, province, false));
indexes.push(this.getIndex('province', code));
}
- if (this.data.columnsNum >= 2) {
+ if (columnsNum >= 2) {
stack.push(picker.setColumnValues(1, city, false));
- indexes.push(this.getIndex('province', code));
+ indexes.push(this.getIndex('city', code));
if (city.length && code.slice(2, 4) === '00') {
code = city[0].code;
}
}
- if (this.data.columnsNum === 3) {
+ if (columnsNum === 3) {
stack.push(
picker.setColumnValues(
2,
@@ -211,6 +212,7 @@ component_1.VantComponent({
false
)
);
+ indexes.push(this.getIndex('county', code));
}
return Promise.all(stack)
.catch(function () {})
diff --git a/lib/picker/shared.js b/lib/picker/shared.js
index 4081f546..9b2ca48a 100644
--- a/lib/picker/shared.js
+++ b/lib/picker/shared.js
@@ -15,7 +15,7 @@ exports.pickerProps = {
},
visibleItemCount: {
type: Number,
- value: 5,
+ value: 6,
},
itemHeight: {
type: Number,
diff --git a/lib/slider/index.js b/lib/slider/index.js
index f945c101..1001a4dd 100644
--- a/lib/slider/index.js
+++ b/lib/slider/index.js
@@ -25,11 +25,15 @@ component_1.VantComponent({
value: {
type: Number,
value: 0,
- observer: 'updateValue',
+ observer: function (val) {
+ if (val !== this.value) {
+ this.updateValue(val);
+ }
+ },
},
barHeight: {
type: null,
- value: '2px',
+ value: 2,
},
},
created: function () {
@@ -39,7 +43,7 @@ component_1.VantComponent({
onTouchStart: function (event) {
if (this.data.disabled) return;
this.touchStart(event);
- this.startValue = this.format(this.data.value);
+ this.startValue = this.format(this.value);
this.dragStatus = 'start';
},
onTouchMove: function (event) {
@@ -77,8 +81,8 @@ component_1.VantComponent({
value = this.format(value);
var min = this.data.min;
var width = ((value - min) * 100) / this.getRange() + '%';
+ this.value = value;
this.setData({
- value: value,
barStyle:
'\n width: ' +
width +
diff --git a/lib/toast/index.wxss b/lib/toast/index.wxss
index da946c9b..2a98d2e2 100644
--- a/lib/toast/index.wxss
+++ b/lib/toast/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(50,50,51,.88);background-color:var(--toast-background-color,rgba(50,50,51,.88));border-radius:4px;border-radius:var(--toast-border-radius,4px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:90px;width:var(--toast-default-width,90px);min-height:90px;min-height:var(--toast-default-min-height,90px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:48px;font-size:var(--toast-icon-size,48px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
+@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(50,50,51,.88);background-color:var(--toast-background-color,rgba(50,50,51,.88));border-radius:8px;border-radius:var(--toast-border-radius,8px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:90px;width:var(--toast-default-width,90px);min-height:90px;min-height:var(--toast-default-min-height,90px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:48px;font-size:var(--toast-icon-size,48px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
diff --git a/package.json b/package.json
index a95d5334..fd30b02a 100644
--- a/package.json
+++ b/package.json
@@ -75,6 +75,7 @@
"progress-bar-webpack-plugin": "^1.11.0",
"style-loader": "^1.0.0",
"stylelint": "^13.0.0",
+ "tscpaths": "^0.0.9",
"typescript": "^3.8.0",
"vue": "2.6.10",
"vue-loader": "^15.7.1",
diff --git a/yarn.lock b/yarn.lock
index ff2c21b4..407d0f63 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5855,7 +5855,7 @@ globby@^6.1.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"
-globby@^9.0.0:
+globby@^9.0.0, globby@^9.2.0:
version "9.2.0"
resolved "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d"
integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==
@@ -11556,6 +11556,14 @@ trough@^1.0.0:
resolved "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406"
integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==
+tscpaths@^0.0.9:
+ version "0.0.9"
+ resolved "https://registry.npm.taobao.org/tscpaths/download/tscpaths-0.0.9.tgz#c77abfde6820920f10c64f83c27753b9505814ab"
+ integrity sha1-x3q/3mggkg8Qxk+DwndTuVBYFKs=
+ dependencies:
+ commander "^2.20.0"
+ globby "^9.2.0"
+
tslib@1.10.0:
version "1.10.0"
resolved "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
From f56f02e9c7cd554094d4131f964e37b39117e6f3 Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 28 Jul 2020 20:52:05 +0800
Subject: [PATCH 069/119] build: release 1.4.1
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index fd30b02a..60733e53 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@vant/weapp",
- "version": "1.4.0",
+ "version": "1.4.1",
"author": "youzan",
"license": "MIT",
"miniprogram": "lib",
From deb670e285b2cf8e70b2383844bcb300893edb8a Mon Sep 17 00:00:00 2001
From: neverland
Date: Wed, 29 Jul 2020 18:14:40 +0800
Subject: [PATCH 070/119] feat(Toast): update style (#3451)
---
example/pages/toast/index.js | 19 +++++++++++++------
example/pages/toast/index.wxml | 15 ++++++++-------
packages/common/style/var.less | 8 ++++----
packages/toast/README.md | 16 ++++++++++++----
4 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/example/pages/toast/index.js b/example/pages/toast/index.js
index e544b94a..7b30a623 100644
--- a/example/pages/toast/index.js
+++ b/example/pages/toast/index.js
@@ -11,7 +11,15 @@ Page({
},
showLoadingToast() {
- Toast.loading({ mask: true, message: '加载中...' });
+ Toast.loading({ message: '加载中...', forbidClick: true });
+ },
+
+ showCustomLoadingToast() {
+ Toast.loading({
+ message: '加载中...',
+ forbidClick: true,
+ loadingType: 'spinner',
+ });
},
showSuccessToast() {
@@ -22,13 +30,12 @@ Page({
Toast.fail('失败提示');
},
- showCustomizedToast(duration) {
- const text = second => `倒计时 ${second} 秒`;
+ showCustomizedToast() {
+ const text = (second) => `倒计时 ${second} 秒`;
const toast = Toast.loading({
duration: 0,
forbidClick: true,
- loadingType: 'spinner',
- message: text(3)
+ message: text(3),
});
let second = 3;
@@ -41,5 +48,5 @@ Page({
Toast.clear();
}
}, 1000);
- }
+ },
});
diff --git a/example/pages/toast/index.wxml b/example/pages/toast/index.wxml
index addf6796..67b83ce0 100644
--- a/example/pages/toast/index.wxml
+++ b/example/pages/toast/index.wxml
@@ -1,19 +1,20 @@
- 文字提示
- 长文字提示
+ 文字提示
+ 长文字提示
- 加载提示
+ 加载提示
+ 自定义加载图标
- 成功提示
- 失败提示
+ 成功提示
+ 失败提示
-
- 高级用法
+
+ 动态更新提示
diff --git a/packages/common/style/var.less b/packages/common/style/var.less
index 71ee8619..cd5f0b74 100644
--- a/packages/common/style/var.less
+++ b/packages/common/style/var.less
@@ -522,13 +522,13 @@
@toast-text-color: @white;
@toast-line-height: 20px;
@toast-border-radius: @border-radius-lg;
-@toast-background-color: rgba(@text-color, 0.88);
-@toast-icon-size: 48px;
+@toast-background-color: fade(@black, 70%);
+@toast-icon-size: 36px;
@toast-text-min-width: 96px;
@toast-text-padding: @padding-xs @padding-sm;
@toast-default-padding: @padding-md;
-@toast-default-width: 90px;
-@toast-default-min-height: 90px;
+@toast-default-width: 88px;
+@toast-default-min-height: 88px;
// GridItem
@grid-item-content-padding: @padding-md @padding-xs;
diff --git a/packages/toast/README.md b/packages/toast/README.md
index e320cd03..a26baa82 100644
--- a/packages/toast/README.md
+++ b/packages/toast/README.md
@@ -26,10 +26,19 @@ Toast('我是提示文案,建议不超过十五字~');
### 加载提示
+使用 `Toast.loading` 方法展示加载提示,通过 `forbidClick` 属性可以禁用背景点击,通过 `loadingType` 属性可以自定义加载图标类型。
+
```javascript
Toast.loading({
- mask: true,
message: '加载中...',
+ forbidClick: true,
+});
+
+// 自定义加载图标
+Toast.loading({
+ message: '加载中...',
+ forbidClick: true,
+ loadingType: 'spinner',
});
```
@@ -40,14 +49,13 @@ Toast.success('成功文案');
Toast.fail('失败文案');
```
-### 高级用法
+### 动态更新提示
```javascript
const toast = Toast.loading({
duration: 0, // 持续展示 toast
- forbidClick: true, // 禁用背景点击
+ forbidClick: true,
message: '倒计时 3 秒',
- loadingType: 'spinner',
selector: '#custom-selector',
});
From 92a3484cb94ea8b5f25224dd6eda63cae73cf644 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 30 Jul 2020 21:17:01 +0800
Subject: [PATCH 071/119] build(deps): bump elliptic from 6.5.2 to 6.5.3
(#3456)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 407d0f63..35bacac2 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3256,7 +3256,7 @@ braces@^3.0.1, braces@~3.0.2:
brorand@^1.0.1:
version "1.1.0"
- resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
+ resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=
browserify-aes@^1.0.0, browserify-aes@^1.0.4:
@@ -4727,9 +4727,9 @@ elegant-spinner@^2.0.0:
integrity sha512-5YRYHhvhYzV/FC4AiMdeSIg3jAYGq9xFvbhZMpPlJoBsfYgrw2DSCYeXfat6tYBu45PWiyRr3+flaCPPmviPaA==
elliptic@^6.0.0, elliptic@^6.5.2:
- version "6.5.2"
- resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762"
- integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==
+ version "6.5.3"
+ resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6"
+ integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==
dependencies:
bn.js "^4.4.0"
brorand "^1.0.1"
@@ -6095,7 +6095,7 @@ hash-sum@^1.0.2:
hash.js@^1.0.0, hash.js@^1.0.3:
version "1.1.7"
- resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42"
+ resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42"
integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==
dependencies:
inherits "^2.0.3"
@@ -6128,7 +6128,7 @@ highlight.js@^9.16.2:
hmac-drbg@^1.0.0:
version "1.0.1"
- resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
+ resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=
dependencies:
hash.js "^1.0.3"
@@ -7941,12 +7941,12 @@ min-indent@^1.0.0:
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
version "1.0.1"
- resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
+ resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==
minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
version "1.0.1"
- resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
+ resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
minimatch@3.0.4, minimatch@^3.0.4:
From 87c6ef6d9e6e67f09b1169347a45c5a035b844fb Mon Sep 17 00:00:00 2001
From: agoni1212 <22545824+agoni1212@users.noreply.github.com>
Date: Fri, 31 Jul 2020 14:09:51 +0800
Subject: [PATCH 072/119] Update Empty guid (#3429)
---
packages/empty/README.md | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/packages/empty/README.md b/packages/empty/README.md
index 56eb1844..22c22b8a 100644
--- a/packages/empty/README.md
+++ b/packages/empty/README.md
@@ -6,13 +6,16 @@
### 引入
-```js
-import Vue from 'vue';
-import { Empty } from 'vant';
+在`app.json`或`index.json`中引入组件,默认为`ES6`版本,`ES5`引入方式参见[快速上手](#/quickstart)
-Vue.use(Empty);
+```json
+"usingComponents": {
+ "van-empty": "@vant/weapp/empty/index"
+}
```
+> Vant Weapp 1.0 版本开始支持此组件,升级方式参见[快速上手](#/quickstart)
+
## 代码演示
### 基础用法
From 53e4f3bf89cbca6a795ef3edf98c23d0403b62af Mon Sep 17 00:00:00 2001
From: rex
Date: Fri, 31 Jul 2020 14:17:58 +0800
Subject: [PATCH 073/119] docs(tree-select): add doc for height (#3460)
---
example/project.config.json | 12 ++++++------
packages/tree-select/README.md | 2 ++
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/example/project.config.json b/example/project.config.json
index 1078db16..9364efef 100644
--- a/example/project.config.json
+++ b/example/project.config.json
@@ -6,6 +6,7 @@
"setting": {
"urlCheck": false,
"es6": true,
+ "enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
@@ -15,20 +16,19 @@
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
+ "uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
+ "compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
- "useCompilerModule": false,
- "userConfirmedUseCompilerModuleSwitch": false,
- "enhance": false,
- "uglifyFileName": false,
- "compileHotReLoad": false,
- "useIsolateContext": true
+ "useIsolateContext": true,
+ "useCompilerModule": true,
+ "userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"cloudfunctionRoot": "functions/",
diff --git a/packages/tree-select/README.md b/packages/tree-select/README.md
index 6bd3ddfb..ced21dbd 100644
--- a/packages/tree-select/README.md
+++ b/packages/tree-select/README.md
@@ -94,6 +94,7 @@ Page({
```html
Date: Fri, 31 Jul 2020 18:58:04 +0800
Subject: [PATCH 074/119] refactor(Tag): update tag style (#3465)
---
example/pages/tag/index.wxml | 5 ---
packages/common/style/var.less | 13 +++++---
packages/tag/README.md | 22 +++++--------
packages/tag/index.less | 57 ++++++++++++++++++++--------------
packages/tag/index.wxml | 2 +-
5 files changed, 50 insertions(+), 49 deletions(-)
diff --git a/example/pages/tag/index.wxml b/example/pages/tag/index.wxml
index 430c466b..49df6246 100644
--- a/example/pages/tag/index.wxml
+++ b/example/pages/tag/index.wxml
@@ -1,5 +1,4 @@
- 标签
标签
标签
标签
@@ -7,7 +6,6 @@
- 标签
标签
标签
标签
@@ -15,7 +13,6 @@
- 标签
标签
标签
标签
@@ -23,7 +20,6 @@
- 标签
标签
标签
标签
@@ -32,7 +28,6 @@
标签
- 标签
标签
标签
标签
标签
标签
标签
@@ -26,10 +25,9 @@
### 空心样式
-设置`plain`属性设置为空心样式
+设置 `plain` 属性设置为空心样式。
```html
-标签
标签
标签
标签
@@ -38,10 +36,9 @@
### 圆角样式
-通过`round`设置为圆角样式
+通过 `round` 设置为圆角样式。
```html
-标签
标签
标签
标签
@@ -50,10 +47,9 @@
### 标记样式
-通过`mark`设置为标记样式(半圆角)
+通过 `mark` 设置为标记样式(半圆角)。
```html
-标签
标签
标签
标签
@@ -64,7 +60,6 @@
```html
标签
-标签
标签
标签
标签
@@ -80,7 +75,7 @@
### 可关闭标签
-添加`closeable`属性表示标签是可关闭的,关闭标签时会触发`close`事件,在`close`事件中可以执行隐藏标签的逻辑
+添加 `closeable` 属性表示标签是可关闭的,关闭标签时会触发 `close` 事件,在 `close` 事件中可以执行隐藏标签的逻辑。
```html
From c3df9397c89a1cbaa02d7c22c8f214a977844684 Mon Sep 17 00:00:00 2001
From: rex
Date: Sat, 1 Aug 2020 09:59:08 +0800
Subject: [PATCH 075/119] fix(calendar): add toast in json (#3466)
fix #3320
---
packages/calendar/index.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/calendar/index.json b/packages/calendar/index.json
index 61dec086..397d5aea 100644
--- a/packages/calendar/index.json
+++ b/packages/calendar/index.json
@@ -4,6 +4,7 @@
"header": "./components/header/index",
"month": "./components/month/index",
"van-button": "../button/index",
- "van-popup": "../popup/index"
+ "van-popup": "../popup/index",
+ "van-toast": "../toast/index"
}
}
From 2d47fb418f87c810ad4be347e50171ef09121d02 Mon Sep 17 00:00:00 2001
From: rex
Date: Sat, 1 Aug 2020 10:21:49 +0800
Subject: [PATCH 076/119] fix(tab): avoid swipe to disabled tab (#3467)
fix #3321
---
packages/tabs/index.ts | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/packages/tabs/index.ts b/packages/tabs/index.ts
index be97e182..3a397b62 100644
--- a/packages/tabs/index.ts
+++ b/packages/tabs/index.ts
@@ -324,17 +324,39 @@ VantComponent({
onTouchEnd() {
if (!this.data.swipeable) return;
- const { tabs, currentIndex } = this.data;
const { direction, deltaX, offsetX } = this;
const minSwipeDistance = 50;
if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
- if (deltaX > 0 && currentIndex !== 0) {
- this.setCurrentIndex(currentIndex - 1);
- } else if (deltaX < 0 && currentIndex !== tabs.length - 1) {
- this.setCurrentIndex(currentIndex + 1);
+ const index = this.getAvaiableTab(deltaX);
+ if (index !== -1) {
+ this.setCurrentIndex(index);
}
}
+ },
+
+ getAvaiableTab(direction: number) {
+ const { tabs, currentIndex } = this.data;
+ const step = direction > 0 ? -1 : 1;
+
+ for (
+ let i = step;
+ currentIndex + i < tabs.length && currentIndex + i >= 0;
+ i += step
+ ) {
+ const index = currentIndex + i;
+
+ if (
+ index >= 0 &&
+ index < tabs.length &&
+ tabs[index] &&
+ !tabs[index].disabled
+ ) {
+ return index;
+ }
+ }
+
+ return -1;
}
}
});
From 31e85aeb6f7a51b422a56024bff76d25028ced34 Mon Sep 17 00:00:00 2001
From: zhongnan
Date: Mon, 3 Aug 2020 20:35:29 +0800
Subject: [PATCH 077/119] build: compile 1.4.2
---
dist/calendar/index.json | 3 ++-
dist/tabs/index.js | 28 +++++++++++++++++++++++-----
dist/tag/index.wxml | 2 +-
dist/tag/index.wxss | 2 +-
dist/toast/index.wxss | 2 +-
lib/calendar/index.json | 3 ++-
lib/tabs/index.js | 40 +++++++++++++++++++++++++++++-----------
lib/tag/index.wxml | 2 +-
lib/tag/index.wxss | 2 +-
lib/toast/index.wxss | 2 +-
10 files changed, 62 insertions(+), 24 deletions(-)
diff --git a/dist/calendar/index.json b/dist/calendar/index.json
index 61dec086..397d5aea 100644
--- a/dist/calendar/index.json
+++ b/dist/calendar/index.json
@@ -4,6 +4,7 @@
"header": "./components/header/index",
"month": "./components/month/index",
"van-button": "../button/index",
- "van-popup": "../popup/index"
+ "van-popup": "../popup/index",
+ "van-toast": "../toast/index"
}
}
diff --git a/dist/tabs/index.js b/dist/tabs/index.js
index 6b73af7c..bb6c9e10 100644
--- a/dist/tabs/index.js
+++ b/dist/tabs/index.js
@@ -269,16 +269,34 @@ VantComponent({
// watch swipe touch end
onTouchEnd() {
if (!this.data.swipeable) return;
- const { tabs, currentIndex } = this.data;
const { direction, deltaX, offsetX } = this;
const minSwipeDistance = 50;
if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
- if (deltaX > 0 && currentIndex !== 0) {
- this.setCurrentIndex(currentIndex - 1);
- } else if (deltaX < 0 && currentIndex !== tabs.length - 1) {
- this.setCurrentIndex(currentIndex + 1);
+ const index = this.getAvaiableTab(deltaX);
+ if (index !== -1) {
+ this.setCurrentIndex(index);
}
}
},
+ getAvaiableTab(direction) {
+ const { tabs, currentIndex } = this.data;
+ const step = direction > 0 ? -1 : 1;
+ for (
+ let i = step;
+ currentIndex + i < tabs.length && currentIndex + i >= 0;
+ i += step
+ ) {
+ const index = currentIndex + i;
+ if (
+ index >= 0 &&
+ index < tabs.length &&
+ tabs[index] &&
+ !tabs[index].disabled
+ ) {
+ return index;
+ }
+ }
+ return -1;
+ },
},
});
diff --git a/dist/tag/index.wxml b/dist/tag/index.wxml
index 8c786865..16ab7508 100644
--- a/dist/tag/index.wxml
+++ b/dist/tag/index.wxml
@@ -1,7 +1,7 @@
diff --git a/dist/tag/index.wxss b/dist/tag/index.wxss
index 0615a993..46df0da0 100644
--- a/dist/tag/index.wxss
+++ b/dist/tag/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-tag{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;line-height:normal;padding:.2em .5em;padding:var(--tag-padding,.2em .5em);color:#fff;color:var(--tag-text-color,#fff);font-size:10px;font-size:var(--tag-font-size,10px);border-radius:.2em;border-radius:var(--tag-border-radius,.2em)}.van-tag:after{border-color:currentColor;border-radius:.2em * 2;border-radius:var(--tag-border-radius,.2em) * 2}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-danger-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-danger-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--mark{padding-right:.7em}.van-tag--mark,.van-tag--mark:after{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--round,.van-tag--round:after{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag--medium{font-size:12px;font-size:var(--tag-medium-font-size,12px)}.van-tag--large{font-size:14px;font-size:var(--tag-large-font-size,14px)}.van-tag__close{margin-left:2px}
\ No newline at end of file
+@import '../common/index.wxss';.van-tag{position:relative;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;padding:0 4px;padding:var(--tag-padding,0 4px);color:#fff;color:var(--tag-text-color,#fff);font-size:12px;font-size:var(--tag-font-size,12px);line-height:16px;line-height:var(--tag-line-height,16px);border-radius:2px;border-radius:var(--tag-border-radius,2px)}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-danger-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-danger-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--plain:before{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:inherit;content:"";pointer-events:none}.van-tag--medium{padding:2px 6px;padding:var(--tag-medium-padding,2px 6px)}.van-tag--large{padding:4px 8px;padding:var(--tag-large-padding,4px 8px);font-size:14px;font-size:var(--tag-large-font-size,14px);border-radius:4px;border-radius:var(--tag-large-border-radius,4px)}.van-tag--mark{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--mark:after{display:block;width:2px;content:""}.van-tag--round{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag__close{min-width:1em;margin-left:2px}
\ No newline at end of file
diff --git a/dist/toast/index.wxss b/dist/toast/index.wxss
index 2a98d2e2..85dc7a8f 100644
--- a/dist/toast/index.wxss
+++ b/dist/toast/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(50,50,51,.88);background-color:var(--toast-background-color,rgba(50,50,51,.88));border-radius:8px;border-radius:var(--toast-border-radius,8px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:90px;width:var(--toast-default-width,90px);min-height:90px;min-height:var(--toast-default-min-height,90px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:48px;font-size:var(--toast-icon-size,48px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
+@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(0,0,0,.7);background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:8px;border-radius:var(--toast-border-radius,8px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:88px;width:var(--toast-default-width,88px);min-height:88px;min-height:var(--toast-default-min-height,88px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:36px;font-size:var(--toast-icon-size,36px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
diff --git a/lib/calendar/index.json b/lib/calendar/index.json
index 61dec086..397d5aea 100644
--- a/lib/calendar/index.json
+++ b/lib/calendar/index.json
@@ -4,6 +4,7 @@
"header": "./components/header/index",
"month": "./components/month/index",
"van-button": "../button/index",
- "van-popup": "../popup/index"
+ "van-popup": "../popup/index",
+ "van-toast": "../toast/index"
}
}
diff --git a/lib/tabs/index.js b/lib/tabs/index.js
index a2855c1b..86d7486f 100644
--- a/lib/tabs/index.js
+++ b/lib/tabs/index.js
@@ -309,21 +309,39 @@ component_1.VantComponent({
// watch swipe touch end
onTouchEnd: function () {
if (!this.data.swipeable) return;
- var _a = this.data,
- tabs = _a.tabs,
- currentIndex = _a.currentIndex;
- var _b = this,
- direction = _b.direction,
- deltaX = _b.deltaX,
- offsetX = _b.offsetX;
+ var _a = this,
+ direction = _a.direction,
+ deltaX = _a.deltaX,
+ offsetX = _a.offsetX;
var minSwipeDistance = 50;
if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
- if (deltaX > 0 && currentIndex !== 0) {
- this.setCurrentIndex(currentIndex - 1);
- } else if (deltaX < 0 && currentIndex !== tabs.length - 1) {
- this.setCurrentIndex(currentIndex + 1);
+ var index = this.getAvaiableTab(deltaX);
+ if (index !== -1) {
+ this.setCurrentIndex(index);
}
}
},
+ getAvaiableTab: function (direction) {
+ var _a = this.data,
+ tabs = _a.tabs,
+ currentIndex = _a.currentIndex;
+ var step = direction > 0 ? -1 : 1;
+ for (
+ var i = step;
+ currentIndex + i < tabs.length && currentIndex + i >= 0;
+ i += step
+ ) {
+ var index = currentIndex + i;
+ if (
+ index >= 0 &&
+ index < tabs.length &&
+ tabs[index] &&
+ !tabs[index].disabled
+ ) {
+ return index;
+ }
+ }
+ return -1;
+ },
},
});
diff --git a/lib/tag/index.wxml b/lib/tag/index.wxml
index 8c786865..16ab7508 100644
--- a/lib/tag/index.wxml
+++ b/lib/tag/index.wxml
@@ -1,7 +1,7 @@
diff --git a/lib/tag/index.wxss b/lib/tag/index.wxss
index 0615a993..46df0da0 100644
--- a/lib/tag/index.wxss
+++ b/lib/tag/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-tag{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;line-height:normal;padding:.2em .5em;padding:var(--tag-padding,.2em .5em);color:#fff;color:var(--tag-text-color,#fff);font-size:10px;font-size:var(--tag-font-size,10px);border-radius:.2em;border-radius:var(--tag-border-radius,.2em)}.van-tag:after{border-color:currentColor;border-radius:.2em * 2;border-radius:var(--tag-border-radius,.2em) * 2}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-danger-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-danger-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--mark{padding-right:.7em}.van-tag--mark,.van-tag--mark:after{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--round,.van-tag--round:after{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag--medium{font-size:12px;font-size:var(--tag-medium-font-size,12px)}.van-tag--large{font-size:14px;font-size:var(--tag-large-font-size,14px)}.van-tag__close{margin-left:2px}
\ No newline at end of file
+@import '../common/index.wxss';.van-tag{position:relative;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;padding:0 4px;padding:var(--tag-padding,0 4px);color:#fff;color:var(--tag-text-color,#fff);font-size:12px;font-size:var(--tag-font-size,12px);line-height:16px;line-height:var(--tag-line-height,16px);border-radius:2px;border-radius:var(--tag-border-radius,2px)}.van-tag--default{background-color:#969799;background-color:var(--tag-default-color,#969799)}.van-tag--default.van-tag--plain{color:#969799;color:var(--tag-default-color,#969799)}.van-tag--danger{background-color:#ee0a24;background-color:var(--tag-danger-color,#ee0a24)}.van-tag--danger.van-tag--plain{color:#ee0a24;color:var(--tag-danger-color,#ee0a24)}.van-tag--primary{background-color:#1989fa;background-color:var(--tag-primary-color,#1989fa)}.van-tag--primary.van-tag--plain{color:#1989fa;color:var(--tag-primary-color,#1989fa)}.van-tag--success{background-color:#07c160;background-color:var(--tag-success-color,#07c160)}.van-tag--success.van-tag--plain{color:#07c160;color:var(--tag-success-color,#07c160)}.van-tag--warning{background-color:#ff976a;background-color:var(--tag-warning-color,#ff976a)}.van-tag--warning.van-tag--plain{color:#ff976a;color:var(--tag-warning-color,#ff976a)}.van-tag--plain{background-color:#fff;background-color:var(--tag-plain-background-color,#fff)}.van-tag--plain:before{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:inherit;content:"";pointer-events:none}.van-tag--medium{padding:2px 6px;padding:var(--tag-medium-padding,2px 6px)}.van-tag--large{padding:4px 8px;padding:var(--tag-large-padding,4px 8px);font-size:14px;font-size:var(--tag-large-font-size,14px);border-radius:4px;border-radius:var(--tag-large-border-radius,4px)}.van-tag--mark{border-radius:0 999px 999px 0;border-radius:0 var(--tag-round-border-radius,999px) var(--tag-round-border-radius,999px) 0}.van-tag--mark:after{display:block;width:2px;content:""}.van-tag--round{border-radius:999px;border-radius:var(--tag-round-border-radius,999px)}.van-tag__close{min-width:1em;margin-left:2px}
\ No newline at end of file
diff --git a/lib/toast/index.wxss b/lib/toast/index.wxss
index 2a98d2e2..85dc7a8f 100644
--- a/lib/toast/index.wxss
+++ b/lib/toast/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(50,50,51,.88);background-color:var(--toast-background-color,rgba(50,50,51,.88));border-radius:8px;border-radius:var(--toast-border-radius,8px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:90px;width:var(--toast-default-width,90px);min-height:90px;min-height:var(--toast-default-min-height,90px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:48px;font-size:var(--toast-icon-size,48px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
+@import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(0,0,0,.7);background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:8px;border-radius:var(--toast-border-radius,8px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:88px;width:var(--toast-default-width,88px);min-height:88px;min-height:var(--toast-default-min-height,88px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:36px;font-size:var(--toast-icon-size,36px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translateY(-30vh);transform:translateY(-30vh)}.van-toast--bottom{-webkit-transform:translateY(30vh);transform:translateY(30vh)}
\ No newline at end of file
From e5e9b27ba4a7fce9ee0748b9f00da608b2343948 Mon Sep 17 00:00:00 2001
From: zhongnan
Date: Mon, 3 Aug 2020 20:35:34 +0800
Subject: [PATCH 078/119] build: release 1.4.2
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 60733e53..ad889ee3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@vant/weapp",
- "version": "1.4.1",
+ "version": "1.4.2",
"author": "youzan",
"license": "MIT",
"miniprogram": "lib",
From 842ca1a8b8540c04b9e0982e1c534d35ac881c3a Mon Sep 17 00:00:00 2001
From: rex
Date: Tue, 4 Aug 2020 16:02:12 +0800
Subject: [PATCH 079/119] feat(dialog): add new prop theme (#3476)
---
example/pages/dialog/index.js | 25 +++++++++++++++----
example/pages/dialog/index.wxml | 9 +++++++
packages/dialog/README.md | 29 ++++++++++++++++++++++
packages/dialog/dialog.ts | 20 ++++++++-------
packages/dialog/index.json | 4 ++-
packages/dialog/index.less | 5 ++++
packages/dialog/index.ts | 42 +++++++++++++++++--------------
packages/dialog/index.wxml | 44 ++++++++++++++++++++++++++++++++-
8 files changed, 143 insertions(+), 35 deletions(-)
diff --git a/example/pages/dialog/index.js b/example/pages/dialog/index.js
index 84558ebe..803a340f 100644
--- a/example/pages/dialog/index.js
+++ b/example/pages/dialog/index.js
@@ -12,6 +12,25 @@ Page({
this.setData({ show: true });
},
+ getUserInfo(event) {
+ console.log(event.detail);
+ },
+
+ onClickThemeAlert() {
+ Dialog.alert({
+ title: '标题',
+ theme: 'round-button',
+ message
+ });
+ },
+
+ onClickThemeAlert2() {
+ Dialog.alert({
+ theme: 'round-button',
+ message
+ });
+ },
+
onClickAlert() {
Dialog.alert({
title: '标题',
@@ -19,10 +38,6 @@ Page({
});
},
- getUserInfo(event) {
- console.log(event.detail);
- },
-
onClickAlert2() {
Dialog.alert({
message
@@ -52,7 +67,7 @@ Page({
});
},
- onClose(event) {
+ onClose() {
this.setData({
show: false
});
diff --git a/example/pages/dialog/index.wxml b/example/pages/dialog/index.wxml
index a732282f..beb07d00 100644
--- a/example/pages/dialog/index.wxml
+++ b/example/pages/dialog/index.wxml
@@ -7,6 +7,15 @@
+
+
+ 提示弹窗
+
+
+ 提示弹窗(无标题)
+
+
+
确认弹窗
diff --git a/packages/dialog/README.md b/packages/dialog/README.md
index 71156840..e42bce50 100644
--- a/packages/dialog/README.md
+++ b/packages/dialog/README.md
@@ -43,6 +43,33 @@ Dialog.alert({
});
```
+### 圆角样式
+
+样式为圆角风格。
+
+```html
+
+```
+
+```javascript
+import Dialog from 'path/to/@vant/weapp/dist/dialog/dialog';
+
+Dialog.alert({
+ title: '标题',
+ message: '弹窗内容',
+ theme: 'round-button',
+}).then(() => {
+ // on close
+});
+
+Dialog.alert({
+ message: '弹窗内容',
+ theme: 'round-button',
+}).then(() => {
+ // on close
+});
+```
+
### 消息确认
用于确认消息,包含取消和确认按钮
@@ -137,6 +164,7 @@ Page({
| title | 标题 | _string_ | - | - |
| width | 弹窗宽度,默认单位为`px` | _string \| number_ | `320px` | 1.0.0 |
| message | 文本内容,支持通过`\n`换行 | _string_ | - | 1.0.0 |
+| theme | 样式风格,可选值为`round-button` | _string_ | `default` |
| messageAlign | 内容对齐方式,可选值为`left` `right` | _string_ | `center` | - |
| zIndex | z-index 层级 | _number_ | `100` | - |
| className | 自定义类名,dialog 在自定义组件内时无效 | _string_ | '' | - |
@@ -179,6 +207,7 @@ Page({
| title | 标题 | _string_ | - |
| width | 弹窗宽度,默认单位为`px` | _string \| number_ | `320px` | 1.0.0 |
| message | 文本内容,支持通过`\n`换行 | _string_ | - |
+| theme | 样式风格,可选值为`round-button` | _string_ | `default` |
| message-align | 内容对齐方式,可选值为`left` `right` | _string_ | `center` |
| z-index | z-index 层级 | _number_ | `100` |
| class-name | 自定义类名,dialog 在自定义组件内时无效 | _string_ | '' |
diff --git a/packages/dialog/dialog.ts b/packages/dialog/dialog.ts
index 29603d53..78eb2a85 100644
--- a/packages/dialog/dialog.ts
+++ b/packages/dialog/dialog.ts
@@ -7,6 +7,7 @@ type DialogOptions = {
title?: string;
width?: string | number;
zIndex?: number;
+ theme?: string;
context?:
| WechatMiniprogram.Page.TrivialInstance
| WechatMiniprogram.Component.TrivialInstance;
@@ -53,10 +54,10 @@ function getContext() {
return pages[pages.length - 1];
}
-const Dialog: Dialog = (options) => {
+const Dialog: Dialog = options => {
options = {
...Dialog.currentOptions,
- ...options,
+ ...options
};
return new Promise((resolve, reject) => {
@@ -70,7 +71,7 @@ const Dialog: Dialog = (options) => {
dialog.setData({
onCancel: reject,
onConfirm: resolve,
- ...options,
+ ...options
});
wx.nextTick(() => {
@@ -90,6 +91,7 @@ Dialog.defaultOptions = {
show: false,
title: '',
width: null,
+ theme: 'default',
message: '',
zIndex: 100,
overlay: true,
@@ -105,31 +107,31 @@ Dialog.defaultOptions = {
showConfirmButton: true,
showCancelButton: false,
closeOnClickOverlay: false,
- confirmButtonOpenType: '',
+ confirmButtonOpenType: ''
};
Dialog.alert = Dialog;
-Dialog.confirm = (options) =>
+Dialog.confirm = options =>
Dialog({
showCancelButton: true,
- ...options,
+ ...options
});
Dialog.close = () => {
- queue.forEach((dialog) => {
+ queue.forEach(dialog => {
dialog.close();
});
queue = [];
};
Dialog.stopLoading = () => {
- queue.forEach((dialog) => {
+ queue.forEach(dialog => {
dialog.stopLoading();
});
};
-Dialog.setDefaultOptions = (options) => {
+Dialog.setDefaultOptions = options => {
Object.assign(Dialog.currentOptions, options);
};
diff --git a/packages/dialog/index.json b/packages/dialog/index.json
index e2ee09ae..1b87cc89 100644
--- a/packages/dialog/index.json
+++ b/packages/dialog/index.json
@@ -2,6 +2,8 @@
"component": true,
"usingComponents": {
"van-popup": "../popup/index",
- "van-button": "../button/index"
+ "van-button": "../button/index",
+ "van-goods-action": "../goods-action//index",
+ "van-goods-action-button": "../goods-action-button/index"
}
}
diff --git a/packages/dialog/index.less b/packages/dialog/index.less
index a66b0107..bcd9a57b 100644
--- a/packages/dialog/index.less
+++ b/packages/dialog/index.less
@@ -53,6 +53,11 @@
&__footer {
display: flex;
+
+ &--round {
+ position: relative !important;
+ padding: 0 @padding-lg - 5px @padding-md !important;
+ }
}
&__button {
diff --git a/packages/dialog/index.ts b/packages/dialog/index.ts
index 6782c79b..7240ed22 100644
--- a/packages/dialog/index.ts
+++ b/packages/dialog/index.ts
@@ -1,7 +1,7 @@
import { VantComponent } from '../common/component';
import { button } from '../mixins/button';
import { openType } from '../mixins/open-type';
-import { GRAY, BLUE } from '../common/color';
+import { GRAY, RED } from '../common/color';
type Action = 'confirm' | 'cancel' | 'overlay';
@@ -13,10 +13,14 @@ VantComponent({
type: Boolean,
observer(show: boolean) {
!show && this.stopLoading();
- },
+ }
},
title: String,
message: String,
+ theme: {
+ type: String,
+ value: 'default'
+ },
useSlot: Boolean,
className: String,
customStyle: String,
@@ -30,43 +34,43 @@ VantComponent({
width: null,
zIndex: {
type: Number,
- value: 2000,
+ value: 2000
},
confirmButtonText: {
type: String,
- value: '确认',
+ value: '确认'
},
cancelButtonText: {
type: String,
- value: '取消',
+ value: '取消'
},
confirmButtonColor: {
type: String,
- value: BLUE,
+ value: RED
},
cancelButtonColor: {
type: String,
- value: GRAY,
+ value: GRAY
},
showConfirmButton: {
type: Boolean,
- value: true,
+ value: true
},
overlay: {
type: Boolean,
- value: true,
+ value: true
},
transition: {
type: String,
- value: 'scale',
- },
+ value: 'scale'
+ }
},
data: {
loading: {
confirm: false,
- cancel: false,
- },
+ cancel: false
+ }
},
methods: {
@@ -85,7 +89,7 @@ VantComponent({
handleAction(action: Action) {
if (this.data.asyncClose) {
this.setData({
- [`loading.${action}`]: true,
+ [`loading.${action}`]: true
});
}
@@ -94,7 +98,7 @@ VantComponent({
close() {
this.setData({
- show: false,
+ show: false
});
},
@@ -102,8 +106,8 @@ VantComponent({
this.setData({
loading: {
confirm: false,
- cancel: false,
- },
+ cancel: false
+ }
});
},
@@ -122,6 +126,6 @@ VantComponent({
if (callback) {
callback(this);
}
- },
- },
+ }
+ }
});
diff --git a/packages/dialog/index.wxml b/packages/dialog/index.wxml
index cbad7f6f..bcec2742 100644
--- a/packages/dialog/index.wxml
+++ b/packages/dialog/index.wxml
@@ -27,7 +27,49 @@
{{ message }}
-
+
+
+
+
diff --git a/packages/tree-select/README.md b/packages/tree-select/README.md
index ced21dbd..970606e6 100644
--- a/packages/tree-select/README.md
+++ b/packages/tree-select/README.md
@@ -115,6 +115,7 @@ Page({
| main-active-index | 左侧选中项的索引 | _number_ | `0` | - |
| active-id | 右侧选中项的 id,支持传入数组 | _string \| number \| Array_ | `0` | - |
| max | 右侧项最大选中个数 | _number_ | _Infinity_ | - |
+| selected-icon `v1.5.0` | 自定义右侧栏选中状态的图标 | _string_ | `success` |
### Events
@@ -140,6 +141,10 @@ Page({
{
// 导航名称
text: '所有城市',
+ // 导航名称右上角徽标,1.5.0 版本开始支持
+ badge: 3,
+ // 是否在导航名称右上角显示小红点,1.5.0 版本开始支持
+ dot: true,
// 禁用选项
disabled: false,
// 该导航下所有的可选项
diff --git a/packages/tree-select/index.ts b/packages/tree-select/index.ts
index 44d24c7f..89b61abe 100644
--- a/packages/tree-select/index.ts
+++ b/packages/tree-select/index.ts
@@ -30,6 +30,10 @@ VantComponent({
type: Number,
value: Infinity,
},
+ selectedIcon: {
+ type: String,
+ value: 'success',
+ },
},
data: {
diff --git a/packages/tree-select/index.wxml b/packages/tree-select/index.wxml
index 547a94af..2663e528 100644
--- a/packages/tree-select/index.wxml
+++ b/packages/tree-select/index.wxml
@@ -13,6 +13,8 @@
custom-class="main-item-class"
active-class="main-active-class"
disabled-class="main-disabled-class"
+ badge="{{ item.badge }}"
+ dot="{{ item.dot }}"
title="{{ item.text }}"
disabled="{{ item.disabled }}"
/>
@@ -30,7 +32,7 @@
{{ item.text }}
From e5cb33d3924da696faa8c76dd60c0a26ca99de45 Mon Sep 17 00:00:00 2001
From: zhongnan
Date: Thu, 27 Aug 2020 10:08:12 +0800
Subject: [PATCH 109/119] build(tsconfig): close strict mode
---
tsconfig.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tsconfig.json b/tsconfig.json
index e193fa0a..7ace8610 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,7 +7,7 @@
"noImplicitAny": false,
"outDir": "dist",
"baseUrl": ".",
- "strict": true,
+ "strict": false,
"types": ["miniprogram-api-typings"],
"paths": {
"definitions/*": ["./packages/definitions/*"],
From b53c4497bd88df65eb68d1cefd39fef8aae37d2e Mon Sep 17 00:00:00 2001
From: zhongnan
Date: Thu, 27 Aug 2020 10:09:42 +0800
Subject: [PATCH 110/119] build: compile 1.5.0
---
dist/area/index.js | 5 +--
dist/calendar/index.js | 5 +--
dist/cell/index.wxss | 2 +-
dist/collapse-item/index.js | 20 +++++++-----
dist/common/index.wxss | 2 +-
dist/common/style/hairline.wxss | 2 +-
dist/empty/index.wxml | 20 +++++++-----
dist/empty/index.wxss | 2 +-
dist/icon/index.wxss | 2 +-
dist/notice-bar/index.js | 5 +--
dist/share-sheet/index.d.ts | 1 +
dist/share-sheet/index.js | 52 +++++++++++++++++++++++++++++++
dist/share-sheet/index.json | 7 +++++
dist/share-sheet/index.wxml | 46 ++++++++++++++++++++++++++++
dist/share-sheet/index.wxs | 12 ++++++++
dist/share-sheet/index.wxss | 1 +
dist/share-sheet/options.d.ts | 1 +
dist/share-sheet/options.js | 14 +++++++++
dist/share-sheet/options.json | 3 ++
dist/share-sheet/options.wxml | 18 +++++++++++
dist/share-sheet/options.wxs | 14 +++++++++
dist/share-sheet/options.wxss | 1 +
dist/sidebar-item/index.js | 1 +
dist/sidebar-item/index.wxml | 5 ++-
dist/submit-bar/index.js | 2 +-
dist/tabs/index.js | 20 +++++-------
dist/tree-select/index.js | 4 +++
dist/tree-select/index.wxml | 4 ++-
lib/area/index.js | 5 +--
lib/calendar/index.js | 5 +--
lib/cell/index.wxss | 2 +-
lib/collapse-item/index.js | 20 +++++++-----
lib/common/index.wxss | 2 +-
lib/common/style/hairline.wxss | 2 +-
lib/empty/index.wxml | 20 +++++++-----
lib/empty/index.wxss | 2 +-
lib/icon/index.wxss | 2 +-
lib/notice-bar/index.js | 5 +--
lib/share-sheet/index.js | 54 +++++++++++++++++++++++++++++++++
lib/share-sheet/index.json | 7 +++++
lib/share-sheet/index.wxml | 46 ++++++++++++++++++++++++++++
lib/share-sheet/index.wxs | 12 ++++++++
lib/share-sheet/index.wxss | 1 +
lib/share-sheet/options.js | 31 +++++++++++++++++++
lib/share-sheet/options.json | 3 ++
lib/share-sheet/options.wxml | 18 +++++++++++
lib/share-sheet/options.wxs | 14 +++++++++
lib/share-sheet/options.wxss | 1 +
lib/sidebar-item/index.js | 1 +
lib/sidebar-item/index.wxml | 5 ++-
lib/tabs/index.js | 20 +++++-------
lib/tree-select/index.js | 4 +++
lib/tree-select/index.wxml | 4 ++-
53 files changed, 472 insertions(+), 85 deletions(-)
create mode 100644 dist/share-sheet/index.d.ts
create mode 100644 dist/share-sheet/index.js
create mode 100644 dist/share-sheet/index.json
create mode 100644 dist/share-sheet/index.wxml
create mode 100644 dist/share-sheet/index.wxs
create mode 100644 dist/share-sheet/index.wxss
create mode 100644 dist/share-sheet/options.d.ts
create mode 100644 dist/share-sheet/options.js
create mode 100644 dist/share-sheet/options.json
create mode 100644 dist/share-sheet/options.wxml
create mode 100644 dist/share-sheet/options.wxs
create mode 100644 dist/share-sheet/options.wxss
create mode 100644 lib/share-sheet/index.js
create mode 100644 lib/share-sheet/index.json
create mode 100644 lib/share-sheet/index.wxml
create mode 100644 lib/share-sheet/index.wxs
create mode 100644 lib/share-sheet/index.wxss
create mode 100644 lib/share-sheet/options.js
create mode 100644 lib/share-sheet/options.json
create mode 100644 lib/share-sheet/options.wxml
create mode 100644 lib/share-sheet/options.wxs
create mode 100644 lib/share-sheet/options.wxss
diff --git a/dist/area/index.js b/dist/area/index.js
index c6216823..17c25b33 100644
--- a/dist/area/index.js
+++ b/dist/area/index.js
@@ -1,5 +1,6 @@
import { VantComponent } from '../common/component';
import { pickerProps } from '../picker/shared';
+import { requestAnimationFrame } from '../common/utils';
const COLUMNSPLACEHOLDERCODE = '000000';
VantComponent({
classes: ['active-class', 'toolbar-class', 'column-class'],
@@ -44,9 +45,9 @@ VantComponent({
typeToColumnsPlaceholder: {},
},
mounted() {
- setTimeout(() => {
+ requestAnimationFrame(() => {
this.setValues();
- }, 0);
+ });
},
methods: {
getPicker() {
diff --git a/dist/calendar/index.js b/dist/calendar/index.js
index e953c6f4..ef2ae517 100644
--- a/dist/calendar/index.js
+++ b/dist/calendar/index.js
@@ -11,6 +11,7 @@ import {
getDayByOffset,
} from './utils';
import Toast from '../toast/toast';
+import { requestAnimationFrame } from '../common/utils';
VantComponent({
props: {
title: {
@@ -157,7 +158,7 @@ VantComponent({
return defaultDate || minDate;
},
scrollIntoView() {
- setTimeout(() => {
+ requestAnimationFrame(() => {
const {
currentDate,
type,
@@ -179,7 +180,7 @@ VantComponent({
}
return false;
});
- }, 100);
+ });
},
onOpen() {
this.$emit('open');
diff --git a/dist/cell/index.wxss b/dist/cell/index.wxss
index 945a0c51..69b245d6 100644
--- a/dist/cell/index.wxss
+++ b/dist/cell/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:auto;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)}
\ No newline at end of file
+@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)}
\ No newline at end of file
diff --git a/dist/collapse-item/index.js b/dist/collapse-item/index.js
index 9ff56b8f..aec309e5 100644
--- a/dist/collapse-item/index.js
+++ b/dist/collapse-item/index.js
@@ -61,14 +61,18 @@ VantComponent({
.then((height) => {
const { animation } = this;
if (expanded) {
- animation
- .height(height)
- .top(1)
- .step({
- duration: inited ? 300 : 1,
- })
- .height('auto')
- .step();
+ if (height === 0) {
+ animation.height('auto').top(1).step();
+ } else {
+ animation
+ .height(height)
+ .top(1)
+ .step({
+ duration: inited ? 300 : 1,
+ })
+ .height('auto')
+ .step();
+ }
this.setData({
animation: animation.export(),
});
diff --git a/dist/common/index.wxss b/dist/common/index.wxss
index 6e6891ff..84ba8da3 100644
--- a/dist/common/index.wxss
+++ b/dist/common/index.wxss
@@ -1 +1 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
diff --git a/dist/common/style/hairline.wxss b/dist/common/style/hairline.wxss
index f64e2f83..74dda718 100644
--- a/dist/common/style/hairline.wxss
+++ b/dist/common/style/hairline.wxss
@@ -1 +1 @@
-.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
+.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file
diff --git a/dist/empty/index.wxml b/dist/empty/index.wxml
index 1c284697..b6a2cb3c 100644
--- a/dist/empty/index.wxml
+++ b/dist/empty/index.wxml
@@ -1,15 +1,21 @@
-
+
-
+
-
+
+
+
+
+
+
+
+
{{ description }}
-
+
+
-
\ No newline at end of file
+
diff --git a/dist/empty/index.wxss b/dist/empty/index.wxss
index 931518d0..aeb9d4b1 100644
--- a/dist/empty/index.wxss
+++ b/dist/empty/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image__img{width:100%;height:100%}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__bottom{margin-top:24px}
\ No newline at end of file
+@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px}
\ No newline at end of file
diff --git a/dist/icon/index.wxss b/dist/icon/index.wxss
index cf2c506c..921d1b63 100644
--- a/dist/icon/index.wxss
+++ b/dist/icon/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medal-o:before{content:"\F083"}.van-icon-medal:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1}
\ No newline at end of file
+@import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-eeb192.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-eeb192.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-eeb192.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-back-top:before{content:"\F0E6"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-enlarge:before{content:"\F0E4"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medal-o:before{content:"\F083"}.van-icon-medal:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-fail:before{content:"\F0E5"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1}
\ No newline at end of file
diff --git a/dist/notice-bar/index.js b/dist/notice-bar/index.js
index 2055065b..83ef873f 100644
--- a/dist/notice-bar/index.js
+++ b/dist/notice-bar/index.js
@@ -1,4 +1,5 @@
import { VantComponent } from '../common/component';
+import { requestAnimationFrame } from '../common/utils';
VantComponent({
props: {
text: {
@@ -99,14 +100,14 @@ VantComponent({
.step()
.export(),
});
- setTimeout(() => {
+ requestAnimationFrame(() => {
this.setData({
animationData: this.animation
.translateX(-this.contentWidth)
.step()
.export(),
});
- }, 20);
+ });
this.timer = setTimeout(() => {
this.scroll();
}, this.duration);
diff --git a/dist/share-sheet/index.d.ts b/dist/share-sheet/index.d.ts
new file mode 100644
index 00000000..cb0ff5c3
--- /dev/null
+++ b/dist/share-sheet/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/share-sheet/index.js b/dist/share-sheet/index.js
new file mode 100644
index 00000000..495dee74
--- /dev/null
+++ b/dist/share-sheet/index.js
@@ -0,0 +1,52 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+ props: {
+ // whether to show popup
+ show: Boolean,
+ // overlay custom style
+ overlayStyle: Object,
+ // z-index
+ zIndex: [Number, String],
+ title: String,
+ cancelText: {
+ type: String,
+ value: '取消',
+ },
+ description: String,
+ options: {
+ type: Array,
+ value: [],
+ },
+ overlay: {
+ type: Boolean,
+ value: true,
+ },
+ safeAreaInsetBottom: {
+ type: Boolean,
+ value: true,
+ },
+ closeOnClickOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ duration: {
+ type: null,
+ value: 300,
+ },
+ },
+ methods: {
+ onClickOverlay() {
+ this.$emit('click-overlay');
+ },
+ onCancel() {
+ this.onClose();
+ this.$emit('cancel');
+ },
+ onSelect(event) {
+ this.$emit('select', event.detail);
+ },
+ onClose() {
+ this.$emit('close');
+ },
+ },
+});
diff --git a/dist/share-sheet/index.json b/dist/share-sheet/index.json
new file mode 100644
index 00000000..15a7c224
--- /dev/null
+++ b/dist/share-sheet/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-popup": "../popup/index",
+ "options": "./options"
+ }
+}
diff --git a/dist/share-sheet/index.wxml b/dist/share-sheet/index.wxml
new file mode 100644
index 00000000..cefc3af4
--- /dev/null
+++ b/dist/share-sheet/index.wxml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/share-sheet/index.wxs b/dist/share-sheet/index.wxs
new file mode 100644
index 00000000..2149ee9e
--- /dev/null
+++ b/dist/share-sheet/index.wxs
@@ -0,0 +1,12 @@
+/* eslint-disable */
+function isMulti(options) {
+ if (options == null || options[0] == null) {
+ return false;
+ }
+
+ return "Array" === options.constructor && "Array" === options[0].constructor;
+}
+
+module.exports = {
+ isMulti: isMulti
+};
diff --git a/dist/share-sheet/index.wxss b/dist/share-sheet/index.wxss
new file mode 100644
index 00000000..8d42eb27
--- /dev/null
+++ b/dist/share-sheet/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-share-sheet__header{padding:12px 16px 4px;text-align:center}.van-share-sheet__title{margin-top:8px;color:#323233;font-weight:400;font-size:14px;line-height:20px}.van-share-sheet__title:empty,.van-share-sheet__title:not(:empty)+.van-share-sheet__title{display:none}.van-share-sheet__description{display:block;margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-share-sheet__description:empty,.van-share-sheet__description:not(:empty)+.van-share-sheet__description{display:none}.van-share-sheet__cancel{display:block;box-sizing:initial;width:100%;height:auto;padding:0;font-size:16px;line-height:48px;text-align:center;background:#fff;border:none}.van-share-sheet__cancel:before{display:block;height:8px;background-color:#f7f8fa;content:" "}.van-share-sheet__cancel:after{display:none}.van-share-sheet__cancel:active{background-color:#f2f3f5}
\ No newline at end of file
diff --git a/dist/share-sheet/options.d.ts b/dist/share-sheet/options.d.ts
new file mode 100644
index 00000000..cb0ff5c3
--- /dev/null
+++ b/dist/share-sheet/options.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/share-sheet/options.js b/dist/share-sheet/options.js
new file mode 100644
index 00000000..c1bd03b2
--- /dev/null
+++ b/dist/share-sheet/options.js
@@ -0,0 +1,14 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+ props: {
+ options: Array,
+ showBorder: Boolean,
+ },
+ methods: {
+ onSelect(event) {
+ const { index } = event.currentTarget.dataset;
+ const option = this.data.options[index];
+ this.$emit('select', Object.assign(Object.assign({}, option), { index }));
+ },
+ },
+});
diff --git a/dist/share-sheet/options.json b/dist/share-sheet/options.json
new file mode 100644
index 00000000..467ce294
--- /dev/null
+++ b/dist/share-sheet/options.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/dist/share-sheet/options.wxml b/dist/share-sheet/options.wxml
new file mode 100644
index 00000000..cb38c7ec
--- /dev/null
+++ b/dist/share-sheet/options.wxml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ {{ item.name }}
+
+ {{ item.description }}
+
+
+
diff --git a/dist/share-sheet/options.wxs b/dist/share-sheet/options.wxs
new file mode 100644
index 00000000..ab6033b9
--- /dev/null
+++ b/dist/share-sheet/options.wxs
@@ -0,0 +1,14 @@
+/* eslint-disable */
+var PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster'];
+
+function getIconURL(icon) {
+ if (PRESET_ICONS.indexOf(icon) !== -1) {
+ return 'https://img.yzcdn.cn/vant/share-icon-' + icon + '.png';
+ }
+
+ return icon;
+}
+
+module.exports = {
+ getIconURL: getIconURL,
+};
diff --git a/dist/share-sheet/options.wxss b/dist/share-sheet/options.wxss
new file mode 100644
index 00000000..e43444fb
--- /dev/null
+++ b/dist/share-sheet/options.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-share-sheet__options{position:relative;display:-webkit-flex;display:flex;padding:16px 0 16px 8px;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch}.van-share-sheet__options--border:before{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:0;left:16px;border-top:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-share-sheet__options::-webkit-scrollbar{height:0}.van-share-sheet__option{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-user-select:none;user-select:none}.van-share-sheet__option:active{opacity:.7}.van-share-sheet__icon{width:48px;height:48px;margin:0 16px}.van-share-sheet__name{margin-top:8px;padding:0 4px;color:#646566;font-size:12px}.van-share-sheet__option-description{padding:0 4px;color:#c8c9cc;font-size:12px}
\ No newline at end of file
diff --git a/dist/sidebar-item/index.js b/dist/sidebar-item/index.js
index 26614daf..f15b69da 100644
--- a/dist/sidebar-item/index.js
+++ b/dist/sidebar-item/index.js
@@ -8,6 +8,7 @@ VantComponent({
},
props: {
dot: Boolean,
+ badge: null,
info: null,
title: String,
disabled: Boolean,
diff --git a/dist/sidebar-item/index.wxml b/dist/sidebar-item/index.wxml
index ab8c6c42..c5c08a62 100644
--- a/dist/sidebar-item/index.wxml
+++ b/dist/sidebar-item/index.wxml
@@ -8,10 +8,9 @@
>
diff --git a/lib/empty/index.wxss b/lib/empty/index.wxss
index 931518d0..aeb9d4b1 100644
--- a/lib/empty/index.wxss
+++ b/lib/empty/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image__img{width:100%;height:100%}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__bottom{margin-top:24px}
\ No newline at end of file
+@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px}
\ No newline at end of file
diff --git a/lib/icon/index.wxss b/lib/icon/index.wxss
index cf2c506c..921d1b63 100644
--- a/lib/icon/index.wxss
+++ b/lib/icon/index.wxss
@@ -1 +1 @@
-@import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medal-o:before{content:"\F083"}.van-icon-medal:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1}
\ No newline at end of file
+@import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-eeb192.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-eeb192.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-eeb192.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-back-top:before{content:"\F0E6"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-enlarge:before{content:"\F0E4"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medal-o:before{content:"\F083"}.van-icon-medal:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-fail:before{content:"\F0E5"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1}
\ No newline at end of file
diff --git a/lib/notice-bar/index.js b/lib/notice-bar/index.js
index 0970eb82..82abda9b 100644
--- a/lib/notice-bar/index.js
+++ b/lib/notice-bar/index.js
@@ -1,6 +1,7 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
+var utils_1 = require('../common/utils');
component_1.VantComponent({
props: {
text: {
@@ -109,14 +110,14 @@ component_1.VantComponent({
.step()
.export(),
});
- setTimeout(function () {
+ utils_1.requestAnimationFrame(function () {
_this.setData({
animationData: _this.animation
.translateX(-_this.contentWidth)
.step()
.export(),
});
- }, 20);
+ });
this.timer = setTimeout(function () {
_this.scroll();
}, this.duration);
diff --git a/lib/share-sheet/index.js b/lib/share-sheet/index.js
new file mode 100644
index 00000000..60fe4e6f
--- /dev/null
+++ b/lib/share-sheet/index.js
@@ -0,0 +1,54 @@
+'use strict';
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+component_1.VantComponent({
+ props: {
+ // whether to show popup
+ show: Boolean,
+ // overlay custom style
+ overlayStyle: Object,
+ // z-index
+ zIndex: [Number, String],
+ title: String,
+ cancelText: {
+ type: String,
+ value: '取消',
+ },
+ description: String,
+ options: {
+ type: Array,
+ value: [],
+ },
+ overlay: {
+ type: Boolean,
+ value: true,
+ },
+ safeAreaInsetBottom: {
+ type: Boolean,
+ value: true,
+ },
+ closeOnClickOverlay: {
+ type: Boolean,
+ value: true,
+ },
+ duration: {
+ type: null,
+ value: 300,
+ },
+ },
+ methods: {
+ onClickOverlay: function () {
+ this.$emit('click-overlay');
+ },
+ onCancel: function () {
+ this.onClose();
+ this.$emit('cancel');
+ },
+ onSelect: function (event) {
+ this.$emit('select', event.detail);
+ },
+ onClose: function () {
+ this.$emit('close');
+ },
+ },
+});
diff --git a/lib/share-sheet/index.json b/lib/share-sheet/index.json
new file mode 100644
index 00000000..15a7c224
--- /dev/null
+++ b/lib/share-sheet/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "usingComponents": {
+ "van-popup": "../popup/index",
+ "options": "./options"
+ }
+}
diff --git a/lib/share-sheet/index.wxml b/lib/share-sheet/index.wxml
new file mode 100644
index 00000000..cefc3af4
--- /dev/null
+++ b/lib/share-sheet/index.wxml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/share-sheet/index.wxs b/lib/share-sheet/index.wxs
new file mode 100644
index 00000000..2149ee9e
--- /dev/null
+++ b/lib/share-sheet/index.wxs
@@ -0,0 +1,12 @@
+/* eslint-disable */
+function isMulti(options) {
+ if (options == null || options[0] == null) {
+ return false;
+ }
+
+ return "Array" === options.constructor && "Array" === options[0].constructor;
+}
+
+module.exports = {
+ isMulti: isMulti
+};
diff --git a/lib/share-sheet/index.wxss b/lib/share-sheet/index.wxss
new file mode 100644
index 00000000..8d42eb27
--- /dev/null
+++ b/lib/share-sheet/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-share-sheet__header{padding:12px 16px 4px;text-align:center}.van-share-sheet__title{margin-top:8px;color:#323233;font-weight:400;font-size:14px;line-height:20px}.van-share-sheet__title:empty,.van-share-sheet__title:not(:empty)+.van-share-sheet__title{display:none}.van-share-sheet__description{display:block;margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-share-sheet__description:empty,.van-share-sheet__description:not(:empty)+.van-share-sheet__description{display:none}.van-share-sheet__cancel{display:block;box-sizing:initial;width:100%;height:auto;padding:0;font-size:16px;line-height:48px;text-align:center;background:#fff;border:none}.van-share-sheet__cancel:before{display:block;height:8px;background-color:#f7f8fa;content:" "}.van-share-sheet__cancel:after{display:none}.van-share-sheet__cancel:active{background-color:#f2f3f5}
\ No newline at end of file
diff --git a/lib/share-sheet/options.js b/lib/share-sheet/options.js
new file mode 100644
index 00000000..f503f4c6
--- /dev/null
+++ b/lib/share-sheet/options.js
@@ -0,0 +1,31 @@
+'use strict';
+var __assign =
+ (this && this.__assign) ||
+ function () {
+ __assign =
+ Object.assign ||
+ function (t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s)
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+ };
+Object.defineProperty(exports, '__esModule', { value: true });
+var component_1 = require('../common/component');
+component_1.VantComponent({
+ props: {
+ options: Array,
+ showBorder: Boolean,
+ },
+ methods: {
+ onSelect: function (event) {
+ var index = event.currentTarget.dataset.index;
+ var option = this.data.options[index];
+ this.$emit('select', __assign(__assign({}, option), { index: index }));
+ },
+ },
+});
diff --git a/lib/share-sheet/options.json b/lib/share-sheet/options.json
new file mode 100644
index 00000000..467ce294
--- /dev/null
+++ b/lib/share-sheet/options.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
diff --git a/lib/share-sheet/options.wxml b/lib/share-sheet/options.wxml
new file mode 100644
index 00000000..cb38c7ec
--- /dev/null
+++ b/lib/share-sheet/options.wxml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ {{ item.name }}
+
+ {{ item.description }}
+
+
+
diff --git a/lib/share-sheet/options.wxs b/lib/share-sheet/options.wxs
new file mode 100644
index 00000000..ab6033b9
--- /dev/null
+++ b/lib/share-sheet/options.wxs
@@ -0,0 +1,14 @@
+/* eslint-disable */
+var PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster'];
+
+function getIconURL(icon) {
+ if (PRESET_ICONS.indexOf(icon) !== -1) {
+ return 'https://img.yzcdn.cn/vant/share-icon-' + icon + '.png';
+ }
+
+ return icon;
+}
+
+module.exports = {
+ getIconURL: getIconURL,
+};
diff --git a/lib/share-sheet/options.wxss b/lib/share-sheet/options.wxss
new file mode 100644
index 00000000..e43444fb
--- /dev/null
+++ b/lib/share-sheet/options.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-share-sheet__options{position:relative;display:-webkit-flex;display:flex;padding:16px 0 16px 8px;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch}.van-share-sheet__options--border:before{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:0;left:16px;border-top:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-share-sheet__options::-webkit-scrollbar{height:0}.van-share-sheet__option{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-user-select:none;user-select:none}.van-share-sheet__option:active{opacity:.7}.van-share-sheet__icon{width:48px;height:48px;margin:0 16px}.van-share-sheet__name{margin-top:8px;padding:0 4px;color:#646566;font-size:12px}.van-share-sheet__option-description{padding:0 4px;color:#c8c9cc;font-size:12px}
\ No newline at end of file
diff --git a/lib/sidebar-item/index.js b/lib/sidebar-item/index.js
index 0cf035ba..a7f0d5e6 100644
--- a/lib/sidebar-item/index.js
+++ b/lib/sidebar-item/index.js
@@ -10,6 +10,7 @@ component_1.VantComponent({
},
props: {
dot: Boolean,
+ badge: null,
info: null,
title: String,
disabled: Boolean,
diff --git a/lib/sidebar-item/index.wxml b/lib/sidebar-item/index.wxml
index ab8c6c42..c5c08a62 100644
--- a/lib/sidebar-item/index.wxml
+++ b/lib/sidebar-item/index.wxml
@@ -8,10 +8,9 @@
>
---
-## 介绍
+### 介绍
-Vant Weapp 是移动端 Vue 组件库 [Vant](https://github.com/youzan/vant) 的小程序版本,两者基于相同的视觉规范,提供一致的 API 接口,助力开发者快速搭建小程序应用。
+Vant 是**有赞前端团队**开源的移动端组件库,于 2016 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万前端开发者,是业界主流的移动端组件库之一。
+
+目前 Vant 官方提供了 [Vue 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),由社区团队维护 [React 版本](https://github.com/mxdi9i7/vant-react)。
## 预览
@@ -120,7 +122,7 @@ Vant Weapp 最低支持到小程序基础库 1.9.9 版本
* [更新日志](https://github.com/youzan/vant-weapp/blob/dev/docs/markdown/changelog.md)
* [意见反馈](https://github.com/youzan/vant-weapp/issues)
* [加入我们](https://job.youzan.com)
-* [Vant: 移动端 Vue UI](https://github.com/youzan/vant)
+* [Vant Vue 版](https://github.com/youzan/vant)
## 开源协议
From ab93888ef1d11672b2240e231550a120c32d57fb Mon Sep 17 00:00:00 2001
From: neverland
Date: Thu, 17 Sep 2020 19:40:21 +0800
Subject: [PATCH 117/119] Update README.md
---
README.md | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/README.md b/README.md
index d9cef3ad..9629811b 100644
--- a/README.md
+++ b/README.md
@@ -11,10 +11,7 @@
- 🔥 文档网站
-
-
- 💡 国内镜像文档
+ 🔥 文档网站
🚀 Vue 版
From d3ee1438b1250a4a9637825886ee918676838ff8 Mon Sep 17 00:00:00 2001
From: neverland
Date: Thu, 17 Sep 2020 19:46:29 +0800
Subject: [PATCH 118/119] Update intro.md
---
docs/markdown/intro.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/markdown/intro.md b/docs/markdown/intro.md
index 474955b0..da677742 100644
--- a/docs/markdown/intro.md
+++ b/docs/markdown/intro.md
@@ -8,7 +8,9 @@
### 介绍
-Vant Weapp 是移动端 Vue 组件库 [Vant](https://github.com/youzan/vant) 的小程序版本,两者基于相同的视觉规范,提供一致的 API 接口,助力开发者快速搭建小程序应用。
+Vant 是**有赞前端团队**开源的移动端组件库,于 2016 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万前端开发者,是业界主流的移动端组件库之一。
+
+目前 Vant 官方提供了 [Vue 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),由社区团队维护 [React 版本](https://github.com/mxdi9i7/vant-react)。
### 预览
From 50bf83a497d3ba1647e1ddf7d954e2cefe0dcb0d Mon Sep 17 00:00:00 2001
From: neverland
Date: Thu, 17 Sep 2020 19:47:37 +0800
Subject: [PATCH 119/119] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 9629811b..7b074ce1 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@
🚀 Vue 版
+
---
### 介绍