From 1c1fb7342bb633c28bb9399adc564debcf2c8cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 18 Jan 2018 15:53:31 +0800 Subject: [PATCH 01/49] [changelog] 0.12.4 --- docs/markdown/en-US/changelog.md | 14 +++++++++++++ docs/markdown/zh-CN/changelog-generated.md | 23 ++++++++++++++++++++++ docs/markdown/zh-CN/changelog.md | 14 +++++++++++++ 3 files changed, 51 insertions(+) diff --git a/docs/markdown/en-US/changelog.md b/docs/markdown/en-US/changelog.md index 69f449aa7..c848da932 100644 --- a/docs/markdown/en-US/changelog.md +++ b/docs/markdown/en-US/changelog.md @@ -1,5 +1,19 @@ ## Changelog +### [0.12.4](https://github.com/youzan/vant/tree/v0.12.4) +`2018-01-18` + +**Improvements** + +* Picker: add props to custom button text [\#548](https://github.com/youzan/vant/pull/548) [@chenjiahan](https://github.com/chenjiahan) +* Toast: add setDefaultOptions method [\#541](https://github.com/youzan/vant/pull/541) [@chenjiahan](https://github.com/chenjiahan) +* Dialog: add setDefaultOptions method [\#539](https://github.com/youzan/vant/pull/539) [@chenjiahan](https://github.com/chenjiahan) + +**Bug Fixes** + +* Stepper: not fire event on changing the value prop [\#546](https://github.com/youzan/vant/pull/546) [@chuangbo](https://github.com/chuangbo) +* Picker: fix misspelling of visibleItemCount prop [\#549](https://github.com/youzan/vant/pull/549) [@chenjiahan](https://github.com/chenjiahan) + ### [0.12.3](https://github.com/youzan/vant/tree/v0.12.3) `2018-01-12` diff --git a/docs/markdown/zh-CN/changelog-generated.md b/docs/markdown/zh-CN/changelog-generated.md index b91722ef0..20e21c83c 100644 --- a/docs/markdown/zh-CN/changelog-generated.md +++ b/docs/markdown/zh-CN/changelog-generated.md @@ -1,5 +1,28 @@ ## 更新日志 +## [v0.12.4](https://github.com/youzan/vant/tree/v0.12.4) (2018-01-18) +[Full Changelog](https://github.com/youzan/vant/compare/v0.12.3...v0.12.4) + +**Issue** + +- \[Stepper\]: should not fire the events on changing the value prop [\#545](https://github.com/youzan/vant/issues/545) +- 有关vant导入所有组件用法示例异常 [\#543](https://github.com/youzan/vant/issues/543) +- 密码输入框组件与数字键盘组件报错 [\#542](https://github.com/youzan/vant/issues/542) +- ImagePreview 组件文档 [\#540](https://github.com/youzan/vant/issues/540) +- 官网文档 Button组件API "disabled" 拼写错误 [\#536](https://github.com/youzan/vant/issues/536) +- TabBar切换颜色没有加深 [\#535](https://github.com/youzan/vant/issues/535) +- 问一个swipe的问题?为什么写了img 写上了v-lazy 没效果 [\#534](https://github.com/youzan/vant/issues/534) +- checkbox的全选取消的问题 [\#533](https://github.com/youzan/vant/issues/533) + +**Improvements** + +- \[bugfix\] Picker: misspelling of visibleItemCount [\#549](https://github.com/youzan/vant/pull/549) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] Picker: add props to custom button text [\#548](https://github.com/youzan/vant/pull/548) ([chenjiahan](https://github.com/chenjiahan)) +- \[bug fix\] Stepper: not fire event on changing the value prop [\#546](https://github.com/youzan/vant/pull/546) ([chuangbo](https://github.com/chuangbo)) +- \[Doc\] fix misspelling of NumberKeyboard [\#544](https://github.com/youzan/vant/pull/544) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] Toast: add setDefaultOptions method [\#541](https://github.com/youzan/vant/pull/541) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] Dialog: add setDefaultOptions method [\#539](https://github.com/youzan/vant/pull/539) ([chenjiahan](https://github.com/chenjiahan)) + ## [v0.12.3](https://github.com/youzan/vant/tree/v0.12.3) (2018-01-12) [Full Changelog](https://github.com/youzan/vant/compare/v0.12.2...v0.12.3) diff --git a/docs/markdown/zh-CN/changelog.md b/docs/markdown/zh-CN/changelog.md index 46f75f9ab..dff7d2bd3 100644 --- a/docs/markdown/zh-CN/changelog.md +++ b/docs/markdown/zh-CN/changelog.md @@ -1,5 +1,19 @@ ## 更新日志 +### [0.12.4](https://github.com/youzan/vant/tree/v0.12.4) +`2018-01-18` + +**Improvements** + +* Picker: 新增 confirmButtonText、cancelButtonText 属性 [\#548](https://github.com/youzan/vant/pull/548) [@chenjiahan](https://github.com/chenjiahan) +* Toast: 新增 setDefaultOptions 方法 [\#541](https://github.com/youzan/vant/pull/541) [@chenjiahan](https://github.com/chenjiahan) +* Dialog: 新增 setDefaultOptions 方法 [\#539](https://github.com/youzan/vant/pull/539) [@chenjiahan](https://github.com/chenjiahan) + +**Bug Fixes** + +* Stepper: 修改 value 值时不触发 change 事件 [\#546](https://github.com/youzan/vant/pull/546) [@chuangbo](https://github.com/chuangbo) +* Picker: 修复 visibleItemCount 属性拼写错误 [\#549](https://github.com/youzan/vant/pull/549) [@chenjiahan](https://github.com/chenjiahan) + ### [0.12.3](https://github.com/youzan/vant/tree/v0.12.3) `2018-01-12` From ddc113a0f5e3a9c2eda6d4164c6ed7e74bac5e34 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 19 Jan 2018 10:02:25 +0800 Subject: [PATCH 02/49] [Improvement] Sku: improve render performance (#550) --- package.json | 16 +- .../{containers/SkuContainer.vue => Sku.vue} | 83 +- packages/sku/components/SkuActions.vue | 23 +- packages/sku/components/SkuHeader.vue | 12 +- packages/sku/components/SkuMessages.vue | 58 +- packages/sku/components/SkuRowItem.vue | 18 +- packages/sku/components/SkuStepper.vue | 15 +- packages/sku/index.js | 18 +- yarn.lock | 744 +++++++++++++++--- 9 files changed, 748 insertions(+), 239 deletions(-) rename packages/sku/{containers/SkuContainer.vue => Sku.vue} (87%) diff --git a/package.json b/package.json index 2f431a5b5..be69ba726 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "vue": ">= 2.5.0" }, "devDependencies": { - "autoprefixer": "^7.2.4", + "autoprefixer": "^7.2.5", "avoriaz": "2.0.0", "babel-cli": "^6.26.0", "babel-core": "^6.26.0", @@ -63,10 +63,10 @@ "chai": "^4.1.2", "codecov": "^3.0.0", "cross-env": "^5.1.3", - "css-loader": "^0.28.8", + "css-loader": "^0.28.9", "dependency-tree": "^5.12.0", "eslint": "^4.15.0", - "eslint-plugin-vue": "^4.1.0", + "eslint-plugin-vue": "^4.2.0", "extract-text-webpack-plugin": "3.0.2", "fast-vue-md-loader": "^1.0.3", "friendly-errors-webpack-plugin": "^1.6.1", @@ -89,7 +89,7 @@ "precss": "2.0.0", "progress-bar-webpack-plugin": "^1.10.0", "rimraf": "^2.5.4", - "shelljs": "^0.7.8", + "shelljs": "^0.8.0", "sinon": "^2.4.1", "sinon-chai": "^2.12.0", "style-loader": "^0.19.1", @@ -97,15 +97,15 @@ "url-loader": "^0.6.2", "vant-doc": "1.0.1", "vue": "^2.5.13", - "vue-loader": "^13.6.2", + "vue-loader": "^13.7.0", "vue-router": "^3.0.1", - "vue-sfc-compiler": "^0.0.7", + "vue-sfc-compiler": "^0.0.8", "vue-style-loader": "^3.0.0", "vue-template-compiler": "^2.5.13", "vue-template-es2015-compiler": "^1.6.0", "webpack": "^3.10.0", - "webpack-bundle-analyzer": "^2.9.1", - "webpack-dev-server": "2.9.7", + "webpack-bundle-analyzer": "^2.9.2", + "webpack-dev-server": "2.11.0", "webpack-merge": "^4.1.1" } } diff --git a/packages/sku/containers/SkuContainer.vue b/packages/sku/Sku.vue similarity index 87% rename from packages/sku/containers/SkuContainer.vue rename to packages/sku/Sku.vue index a5c595d79..dbacacd97 100644 --- a/packages/sku/containers/SkuContainer.vue +++ b/packages/sku/Sku.vue @@ -2,7 +2,12 @@
- +
- +
- - + +
- + /* eslint-disable camelcase */ import Vue from 'vue'; -import Popup from '../../popup'; -import Toast from '../../toast'; -import SkuHeader from '../components/SkuHeader'; -import SkuRow from '../components/SkuRow'; -import SkuRowItem from '../components/SkuRowItem'; -import SkuStepper from '../components/SkuStepper'; -import SkuMessages from '../components/SkuMessages'; -import SkuActions from '../components/SkuActions'; +import Popup from '../popup'; +import Toast from '../toast'; +import SkuHeader from './components/SkuHeader'; +import SkuRow from './components/SkuRow'; +import SkuRowItem from './components/SkuRowItem'; +import SkuStepper from './components/SkuStepper'; +import SkuMessages from './components/SkuMessages'; +import SkuActions from './components/SkuActions'; import { isAllSelected, getSkuComb, getSelectedSkuValues -} from '../utils/skuHelper'; -import { LIMIT_TYPE } from '../constants'; -import { create } from '../../utils'; +} from './utils/skuHelper'; +import { LIMIT_TYPE } from './constants'; +import { create } from '../utils'; const { QUOTA_LIMIT } = LIMIT_TYPE; @@ -107,13 +118,19 @@ export default create({ }, props: { + sku: Object, goods: Object, + value: Boolean, + buyText: String, goodsId: [Number, String], + stepperTitle: String, + hideStock: Boolean, + resetStepperOnHide: Boolean, + disableStepperInput: Boolean, initialSku: { type: Object, default: () => ({}) }, - sku: Object, quota: { type: Number, default: 0 @@ -122,24 +139,18 @@ export default create({ type: Number, default: 0 }, - hideStock: Boolean, showAddCartBtn: { type: Boolean, default: true }, - buyText: String, - stepperTitle: String, bodyOffsetTop: { type: Number, default: 200 }, - resetStepperOnHide: Boolean, - disableStepperInput: Boolean, messagePlaceholderMap: { type: Object, default: () => ({}) - }, - value: Boolean + } }, data() { @@ -192,19 +203,19 @@ export default create({ maxHeight: maxHeight + 'px' }; }, + isSkuCombSelected() { return isAllSelected(this.sku.tree, this.selectedSku); }, - // sku数据不存在时不渲染模板 + isSkuEmpty() { - for (var key in this.sku) { - if (Object.prototype.hasOwnProperty.call(this.sku, key)) return false; - } - return true; + return Object.keys(this.sku).length === 0; }, + hasSku() { return !this.sku.none_sku; }, + selectedSkuComb() { if (!this.hasSku) { return { @@ -217,13 +228,14 @@ export default create({ } return null; }, + skuTree() { return this.sku.tree || []; } }, created() { - var skuEventBus = new Vue(); + const skuEventBus = new Vue(); this.skuEventBus = skuEventBus; skuEventBus.$on('sku:close', this.handleCloseClicked); @@ -250,19 +262,23 @@ export default create({ } }); }, + getSkuMessages() { return this.$refs.skuMessages ? this.$refs.skuMessages.getMessages() : {}; }, + getSkuCartMessages() { return this.$refs.skuMessages ? this.$refs.skuMessages.getCartMessages() : {}; }, + validateSkuMessages() { return this.$refs.skuMessages ? this.$refs.skuMessages.validateMessages() : ''; }, + validateSku() { if (this.selectedNum === 0) { return this.$t('unavailable'); @@ -276,9 +292,11 @@ export default create({ return this.$t('spec'); } }, + handleCloseClicked() { this.show = false; }, + handleSkuSelected(skuValue) { // 点击已选中的sku时则取消选中 this.selectedSku = @@ -292,9 +310,11 @@ export default create({ selectedSkuComb: this.selectedSkuComb }); }, + handleNumChange(num) { this.selectedNum = num; }, + handleOverLimit({ action, limitType, quota, quotaUsed }) { if (action === 'minus') { Toast(this.$t('least')); @@ -308,12 +328,15 @@ export default create({ } } }, + handleAddCartClicked() { this.handleBuyOrAddCart('add-cart'); }, + handleBuyClicked() { this.handleBuyOrAddCart('buy-clicked'); }, + handleBuyOrAddCart(type) { const error = this.validateSku(); if (error) { diff --git a/packages/sku/components/SkuActions.vue b/packages/sku/components/SkuActions.vue index 199128944..1654c7b29 100644 --- a/packages/sku/components/SkuActions.vue +++ b/packages/sku/components/SkuActions.vue @@ -1,7 +1,17 @@ @@ -20,15 +30,6 @@ export default create({ buyText: String, skuEventBus: Object, showAddCartBtn: Boolean - }, - - methods: { - onAddCartClicked() { - this.skuEventBus.$emit('sku:addCart'); - }, - onBuyClicked() { - this.skuEventBus.$emit('sku:buy'); - } } }); diff --git a/packages/sku/components/SkuHeader.vue b/packages/sku/components/SkuHeader.vue index cbe82c8c6..b8469abd9 100644 --- a/packages/sku/components/SkuHeader.vue +++ b/packages/sku/components/SkuHeader.vue @@ -1,12 +1,12 @@ @@ -26,9 +26,6 @@ export default create({ }, computed: { - skuTree() { - return this.sku.tree; - }, goodsImg() { const s1Id = this.selectedSku.s1; const skuImg = this.getSkuImg(s1Id); @@ -45,14 +42,11 @@ export default create({ }, methods: { - onCloseClicked() { - this.skuEventBus.$emit('sku:close'); - }, getSkuImg(id) { if (!id) return; // 目前skuImg都挂载在skuTree中s1那类sku上 - const treeItem = this.skuTree.filter(treeItem => treeItem.k_s === 's1')[0] || {}; + const treeItem = this.sku.tree.filter(treeItem => treeItem.k_s === 's1')[0] || {}; if (!treeItem.v) { return; diff --git a/packages/sku/components/SkuMessages.vue b/packages/sku/components/SkuMessages.vue index e72796c25..a1839030c 100644 --- a/packages/sku/components/SkuMessages.vue +++ b/packages/sku/components/SkuMessages.vue @@ -1,26 +1,14 @@ @@ -35,6 +35,7 @@ export default create({ name: 'van-button', props: { + text: String, block: Boolean, loading: Boolean, disabled: Boolean, diff --git a/packages/dialog/dialog.vue b/packages/dialog/dialog.vue index 4a8f0349b..166bf115e 100644 --- a/packages/dialog/dialog.vue +++ b/packages/dialog/dialog.vue @@ -50,14 +50,11 @@ export default create({ callback: Function, confirmButtonText: String, cancelButtonText: String, + showCancelButton: Boolean, showConfirmButton: { type: Boolean, default: true }, - showCancelButton: { - type: Boolean, - default: false - }, overlay: { type: Boolean, default: true From e8006f45d92dac0ad8f265ed8e300211a53a9648 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 23 Jan 2018 15:41:14 +0800 Subject: [PATCH 08/49] [Improvement] update dependencies (#565) --- package.json | 10 +++--- yarn.lock | 92 ++++++++++++++++++++++++---------------------------- 2 files changed, 48 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index be69ba726..88a54e505 100644 --- a/package.json +++ b/package.json @@ -64,8 +64,8 @@ "codecov": "^3.0.0", "cross-env": "^5.1.3", "css-loader": "^0.28.9", - "dependency-tree": "^5.12.0", - "eslint": "^4.15.0", + "dependency-tree": "^6.0.0", + "eslint": "^4.16.0", "eslint-plugin-vue": "^4.2.0", "extract-text-webpack-plugin": "3.0.2", "fast-vue-md-loader": "^1.0.3", @@ -89,13 +89,13 @@ "precss": "2.0.0", "progress-bar-webpack-plugin": "^1.10.0", "rimraf": "^2.5.4", - "shelljs": "^0.8.0", + "shelljs": "^0.8.1", "sinon": "^2.4.1", "sinon-chai": "^2.12.0", "style-loader": "^0.19.1", "uppercamelcase": "^3.0.0", "url-loader": "^0.6.2", - "vant-doc": "1.0.1", + "vant-doc": "1.0.2", "vue": "^2.5.13", "vue-loader": "^13.7.0", "vue-router": "^3.0.1", @@ -105,7 +105,7 @@ "vue-template-es2015-compiler": "^1.6.0", "webpack": "^3.10.0", "webpack-bundle-analyzer": "^2.9.2", - "webpack-dev-server": "2.11.0", + "webpack-dev-server": "2.11.1", "webpack-merge": "^4.1.1" } } diff --git a/yarn.lock b/yarn.lock index 2781472f0..d31cba799 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1928,14 +1928,14 @@ depd@~1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" -dependency-tree@^5.12.0: - version "5.12.0" - resolved "https://registry.yarnpkg.com/dependency-tree/-/dependency-tree-5.12.0.tgz#a1b7a625428a6e09bc4ce5c133fa5f6bcc9626d3" +dependency-tree@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/dependency-tree/-/dependency-tree-6.0.0.tgz#88577c5410356b11ddec84f457b0609a24ff5d39" dependencies: commander "^2.6.0" debug "^3.1.0" - filing-cabinet "^1.12.0" - precinct "^3.8.0" + filing-cabinet "^1.13.0" + precinct "^4.0.0" des.js@^1.0.0: version "1.0.0" @@ -2012,13 +2012,13 @@ detective-stylus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/detective-stylus/-/detective-stylus-1.0.0.tgz#50aee7db8babb990381f010c63fabba5b58e54cd" -detective-typescript@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/detective-typescript/-/detective-typescript-1.0.1.tgz#6affa0d4bf8ca500194f30c28be445c99fecf81d" +detective-typescript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/detective-typescript/-/detective-typescript-2.0.0.tgz#dc619fc3d69ccd59021412c5855a6ff22f41a710" dependencies: node-source-walk "3.2.0" - typescript "2.0.10" - typescript-eslint-parser "1.0.2" + typescript "^2.6.1" + typescript-eslint-parser "^9.0.0" di@^0.0.1: version "0.0.1" @@ -2057,7 +2057,7 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" -doctrine@^2.0.2: +doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" dependencies: @@ -2375,9 +2375,9 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@^4.15.0: - version "4.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.15.0.tgz#89ab38c12713eec3d13afac14e4a89e75ef08145" +eslint@^4.16.0: + version "4.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.16.0.tgz#934ada9e98715e1d7bbfd6f6f0519ed2fab35cc1" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -2385,7 +2385,7 @@ eslint@^4.15.0: concat-stream "^1.6.0" cross-spawn "^5.1.0" debug "^3.1.0" - doctrine "^2.0.2" + doctrine "^2.1.0" eslint-scope "^3.7.1" eslint-visitor-keys "^1.0.0" espree "^3.5.2" @@ -2719,7 +2719,7 @@ filesize@^3.5.9: version "3.5.11" resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.5.11.tgz#1919326749433bb3cf77368bd158caabcc19e9ee" -filing-cabinet@^1.12.0: +filing-cabinet@^1.13.0: version "1.13.1" resolved "https://registry.yarnpkg.com/filing-cabinet/-/filing-cabinet-1.13.1.tgz#548d0efa45fcc586fe7734c155aa145ff5a37ef4" dependencies: @@ -4178,15 +4178,9 @@ lodash.some@^4.4.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" -lodash.tostring@^4.0.0: - version "4.1.4" - resolved "https://registry.yarnpkg.com/lodash.tostring/-/lodash.tostring-4.1.4.tgz#560c27d1f8eadde03c2cce198fef5c031d8298fb" - -lodash.unescape@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.0.tgz#36debfc492b81478471ef974cd3783e202eb6cef" - dependencies: - lodash.tostring "^4.0.0" +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" lodash.uniq@^4.5.0: version "4.5.0" @@ -5531,9 +5525,9 @@ postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.13, postcss@^6.0.1 source-map "^0.6.1" supports-color "^5.1.0" -precinct@^3.8.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/precinct/-/precinct-3.8.0.tgz#259a9490a85477a1f26989fbdf2fb26c44f2475a" +precinct@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/precinct/-/precinct-4.0.0.tgz#ce67108123b8ae7c156180fb3836c5e5de24654f" dependencies: commander "^2.11.0" debug "^3.0.1" @@ -5544,7 +5538,7 @@ precinct@^3.8.0: detective-sass "^2.0.0" detective-scss "^1.0.0" detective-stylus "^1.0.0" - detective-typescript "^1.0.0" + detective-typescript "^2.0.0" module-definition "^2.2.4" node-source-walk "^3.3.0" @@ -6151,6 +6145,10 @@ selfsigned@^1.9.1: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +semver@5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + semver@~4.3.3: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" @@ -6255,9 +6253,9 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shelljs@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.0.tgz#12f561c52ec5d0d3315af15616c011a18ff80d59" +shelljs@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.1.tgz#729e038c413a2254c4078b95ed46e0397154a9f1" dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -6858,18 +6856,14 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript-eslint-parser@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-1.0.2.tgz#fd2abacf2ee3d9382ab3e449c8762b6beae4d0d7" +typescript-eslint-parser@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-9.0.1.tgz#1497a565d192ca2a321bc5bbf89dcab0a2da75e8" dependencies: - lodash.unescape "4.0.0" - object-assign "^4.0.1" + lodash.unescape "4.0.1" + semver "5.4.1" -typescript@2.0.10: - version "2.0.10" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.0.10.tgz#ccdd4ed86fd5550a407101a0814012e1b3fac3dd" - -typescript@^2.4.2: +typescript@^2.4.2, typescript@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" @@ -7064,9 +7058,9 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -vant-doc@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vant-doc/-/vant-doc-1.0.1.tgz#88ac3e7662daa813333eb35bba7648918b7cf47e" +vant-doc@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/vant-doc/-/vant-doc-1.0.2.tgz#abf5e17a53cae03475095c370500dec7a245d54a" dependencies: cheerio "0.22.0" decamelize "^1.2.0" @@ -7215,9 +7209,9 @@ webpack-dev-middleware@1.12.2, webpack-dev-middleware@^1.12.0: range-parser "^1.0.3" time-stamp "^2.0.0" -webpack-dev-server@2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.11.0.tgz#e9d4830ab7eb16c6f92ed68b92f6089027960e1b" +webpack-dev-server@2.11.1: + version "2.11.1" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.11.1.tgz#6f9358a002db8403f016e336816f4485384e5ec0" dependencies: ansi-html "0.0.7" array-includes "^3.0.3" @@ -7242,7 +7236,7 @@ webpack-dev-server@2.11.0: sockjs "0.3.19" sockjs-client "1.1.4" spdy "^3.4.1" - strip-ansi "^4.0.0" + strip-ansi "^3.0.0" supports-color "^5.1.0" webpack-dev-middleware "1.12.2" yargs "6.6.0" From fc0530733559a5ea81d869c00a37dafa6d30a179 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 23 Jan 2018 19:38:26 +0800 Subject: [PATCH 09/49] [Improvement] CouponList: support v-model & exchangeButtonLoading (#566) --- docs/markdown/en-US/coupon.md | 2 ++ docs/markdown/zh-CN/coupon.md | 6 +++-- packages/coupon-list/index.vue | 46 +++++++++++++++++++++++----------- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/docs/markdown/en-US/coupon.md b/docs/markdown/en-US/coupon.md index defbca20b..f66831482 100644 --- a/docs/markdown/en-US/coupon.md +++ b/docs/markdown/en-US/coupon.md @@ -79,10 +79,12 @@ export default { | Attribute | Description | Type | Default | Accepted Values | |-----------|-----------|-----------|-------------|-------------| +| v-model | Current exchange code | `String` | - | - | | chosen-coupon | Index of chosen coupon | `Number` | `-1` | - | | coupons | Coupon list | `Array` | `[]` | - | | disabled-coupons | Disabled voupon list | `Array` | `[]` | - | | exchange-button-text | Exchange button text | `String` | `Exchange` | - | +| exchange-button-loading | Whether to show loading in exchange button | `Boolean` | `false` | - | | exchange-button-disabled | Whether to disable exchange button | `Boolean` | `false` | - | | exchange-min-length | Min length to enable exchange button | `Number` | `1` | - | | displayed-coupon-index | Index of displayed coupon | `Number` | - | - | diff --git a/docs/markdown/zh-CN/coupon.md b/docs/markdown/zh-CN/coupon.md index 7c7f25b7f..a9b5685fc 100644 --- a/docs/markdown/zh-CN/coupon.md +++ b/docs/markdown/zh-CN/coupon.md @@ -69,7 +69,7 @@ export default { ### CouponCell API -| 参数 | 说明 | 类型 | 默认值 | 必须 | +| 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| | title | 单元格标题 | `String` | `优惠券码` | - | | chosen-coupon | 当前选中优惠券的索引 | `Number` | `-1` | - | @@ -78,12 +78,14 @@ export default { ### CouponList API -| 参数 | 说明 | 类型 | 默认值 | 必须 | +| 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| +| v-model | 当前输入的兑换码 | `String` | - | - | | chosen-coupon | 当前选中优惠券的索引 | `Number` | `-1` | - | | coupons | 可用优惠券列表 | `Array` | `[]` | - | | disabled-doupons | 不可用优惠券列表 | `Array` | `[]` | - | | exchange-button-text | 兑换按钮文字 | `String` | `兑换` | - | +| exchange-button-loading | 是否在兑换按钮上显示加载动画 | `Boolean` | `false` | - | | exchange-button-disabled | 是否禁用兑换按钮 | `Boolean` | `false` | - | | exchange-min-length | 兑换码最小长度 | `Number` | `1` | - | | displayed-coupon-index | 滚动至特定优惠券位置 | `Number` | - | - | diff --git a/packages/coupon-list/index.vue b/packages/coupon-list/index.vue index 6dafd73a2..b3dddeda5 100644 --- a/packages/coupon-list/index.vue +++ b/packages/coupon-list/index.vue @@ -3,7 +3,7 @@ @@ -12,6 +12,7 @@ type="danger" class="van-coupon-list__exchange" :text="exchangeButtonText || $t('exchange')" + :loading="exchangeButtonLoading" :disabled="buttonDisabled" @click="onClickExchangeButton" /> @@ -23,7 +24,7 @@ :key="item.id || item.name" :data="item" :chosen="index === chosenCoupon" - @click.native="onClickCoupon(index)" + @click.native="$emit('change', index)" />

{{ disabledListTitle || $t('disabled') }}

@@ -67,11 +68,17 @@ export default create({ CouponItem }, + model: { + prop: 'code' + }, + props: { + code: String, closeButtonText: String, inputPlaceholder: String, disabledListTitle: String, exchangeButtonText: String, + exchangeButtonLoading: Boolean, exchangeButtonDisabled: Boolean, exchangeMinLength: { type: Number, @@ -105,17 +112,29 @@ export default create({ data() { return { - exchangeCode: '' + currentCode: this.code || '' }; }, computed: { buttonDisabled() { - return this.exchangeButtonDisabled || this.exchangeCode.length < this.exchangeMinLength; + return ( + !this.exchangeButtonLoading && + (this.exchangeButtonDisabled || + this.currentCode.length < this.exchangeMinLength) + ); } }, watch: { + code(code) { + this.currentCode = code; + }, + + currentCode(code) { + this.$emit('input', code); + }, + displayedCouponIndex(val) { this.scrollToShowCoupon(val); } @@ -126,17 +145,16 @@ export default create({ }, methods: { - onClickNotUse() { - this.$emit('change', -1); - }, - onClickCoupon(index) { - this.$emit('change', index); - }, onClickExchangeButton() { - this.$emit('exchange', this.exchangeCode); - this.exchangeCode = ''; + this.$emit('exchange', this.currentCode); + + // auto clear currentCode when not use v-model + if (!this.code) { + this.currentCode = ''; + } }, - // 滚动到特定优惠券的位置 + + // scroll to show specific coupon scrollToShowCoupon(index) { if (index === -1) { return; From 149064ed37bda33ca39d588baf0c6bc9ac2fb71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Tue, 23 Jan 2018 19:40:54 +0800 Subject: [PATCH 10/49] [build] 0.12.5 --- packages/index.js | 2 +- packages/vant-css/package-lock.json | 2 +- packages/vant-css/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/index.js b/packages/index.js index e0f2a340f..2a7c59799 100644 --- a/packages/index.js +++ b/packages/index.js @@ -62,7 +62,7 @@ import TreeSelect from './tree-select'; import Uploader from './uploader'; import Waterfall from './waterfall'; -const version = '0.12.4'; +const version = '0.12.5'; const components = [ Actionsheet, AddressEdit, diff --git a/packages/vant-css/package-lock.json b/packages/vant-css/package-lock.json index aa600254b..41cef9cdf 100644 --- a/packages/vant-css/package-lock.json +++ b/packages/vant-css/package-lock.json @@ -1,6 +1,6 @@ { "name": "vant-css", - "version": "0.12.4", + "version": "0.12.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/vant-css/package.json b/packages/vant-css/package.json index 8324ee74f..a46b94fca 100644 --- a/packages/vant-css/package.json +++ b/packages/vant-css/package.json @@ -1,6 +1,6 @@ { "name": "vant-css", - "version": "0.12.4", + "version": "0.12.5", "description": "vant css.", "main": "lib/index.css", "style": "lib/index.css", From 68df1d93580ca5fd4a29a218af425489bac6faa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Tue, 23 Jan 2018 19:40:55 +0800 Subject: [PATCH 11/49] [release] 0.12.5 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index cba6758a1..289c23cbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "0.12.4", + "version": "0.12.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 88a54e505..a289dfa7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "0.12.4", + "version": "0.12.5", "description": "A Vue.js 2.0 Mobile UI at YouZan", "main": "lib/vant.js", "style": "lib/vant-css/index.css", From fdcb16fbd2efe1175639f9c141d4ad6d275a8d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Tue, 23 Jan 2018 19:52:13 +0800 Subject: [PATCH 12/49] [changelog] 0.12.5 --- docs/markdown/en-US/changelog.md | 16 +++++++++++++ docs/markdown/zh-CN/changelog-generated.md | 27 ++++++++++++++++++++++ docs/markdown/zh-CN/changelog.md | 15 ++++++++++++ 3 files changed, 58 insertions(+) diff --git a/docs/markdown/en-US/changelog.md b/docs/markdown/en-US/changelog.md index c848da932..017725342 100644 --- a/docs/markdown/en-US/changelog.md +++ b/docs/markdown/en-US/changelog.md @@ -1,5 +1,21 @@ ## Changelog + +### [0.12.5](https://github.com/youzan/vant/tree/v0.12.5) +`2018-01-23` + +**Improvements** + +* Button: add text prop [\#563](https://github.com/youzan/vant/pull/563) [@chenjiahan](https://github.com/chenjiahan) +* CouponList: support v-model、exchangeButtonLoading、exchangeMinLength [\#556](https://github.com/youzan/vant/pull/556) [\#566](https://github.com/youzan/vant/pull/566) [@chenjiahan](https://github.com/chenjiahan) +* Icon: update share icon [\#562](https://github.com/youzan/vant/pull/562) [@chenjiahan](https://github.com/chenjiahan) +* Sku: improve render performance [\#550](https://github.com/youzan/vant/pull/550) [@chenjiahan](https://github.com/chenjiahan) + +**Bug Fixes** +* Area: should not display city & county list when not select province [\#560](https://github.com/youzan/vant/pull/560) [@chenjiahan](https://github.com/chenjiahan) +* Cell: fix required style [\#553](https://github.com/youzan/vant/pull/553) [@qianzhaoy](https://github.com/qianzhaoy) + + ### [0.12.4](https://github.com/youzan/vant/tree/v0.12.4) `2018-01-18` diff --git a/docs/markdown/zh-CN/changelog-generated.md b/docs/markdown/zh-CN/changelog-generated.md index 20e21c83c..fae164c9d 100644 --- a/docs/markdown/zh-CN/changelog-generated.md +++ b/docs/markdown/zh-CN/changelog-generated.md @@ -1,5 +1,32 @@ ## 更新日志 +## [v0.12.5](https://github.com/youzan/vant/tree/v0.12.5) (2018-01-23) +[Full Changelog](https://github.com/youzan/vant/compare/v0.12.4...v0.12.5) + +**Issue** + +- ssr项目使用时css加载错误 [\#561](https://github.com/youzan/vant/issues/561) +- css加载报错 [\#559](https://github.com/youzan/vant/issues/559) +- tabbar的active手动设置不生效 [\#558](https://github.com/youzan/vant/issues/558) +- 页面手动刷新 tabbar 会 回到起始路由页面对应的 active icon [\#557](https://github.com/youzan/vant/issues/557) +- 轮播图van-swipe 懒加载图片v-lazy 使用报错Failed to resolve directive: lazy [\#554](https://github.com/youzan/vant/issues/554) +- ssr 使用 babel-plugin-import报错 [\#552](https://github.com/youzan/vant/issues/552) +- stepper如何放到cell里面? [\#551](https://github.com/youzan/vant/issues/551) +- DatetimePicker设置每一列可见元素个数visibile-column-count失效 [\#547](https://github.com/youzan/vant/issues/547) +- Toast 和 Dialog 增加全局参数配置 [\#538](https://github.com/youzan/vant/issues/538) +- picker 组件文档 [\#537](https://github.com/youzan/vant/issues/537) + +**Improvements** + +- \[Improvement\] CouponList: support v-model & exchangeButtonLoading [\#566](https://github.com/youzan/vant/pull/566) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] update dependencies [\#565](https://github.com/youzan/vant/pull/565) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] Button: add text prop [\#563](https://github.com/youzan/vant/pull/563) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] Icon: update share icon [\#562](https://github.com/youzan/vant/pull/562) ([chenjiahan](https://github.com/chenjiahan)) +- \[bugfix\] Area: should not display city & county list when not select province [\#560](https://github.com/youzan/vant/pull/560) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] CouponList: add exchangeMinLength prop [\#556](https://github.com/youzan/vant/pull/556) ([chenjiahan](https://github.com/chenjiahan)) +- \[bugfix\] Cell: fix required style [\#553](https://github.com/youzan/vant/pull/553) ([qianzhaoy](https://github.com/qianzhaoy)) +- \[Improvement\] Sku: improve render performance [\#550](https://github.com/youzan/vant/pull/550) ([chenjiahan](https://github.com/chenjiahan)) + ## [v0.12.4](https://github.com/youzan/vant/tree/v0.12.4) (2018-01-18) [Full Changelog](https://github.com/youzan/vant/compare/v0.12.3...v0.12.4) diff --git a/docs/markdown/zh-CN/changelog.md b/docs/markdown/zh-CN/changelog.md index dff7d2bd3..fe2207b67 100644 --- a/docs/markdown/zh-CN/changelog.md +++ b/docs/markdown/zh-CN/changelog.md @@ -1,5 +1,20 @@ ## 更新日志 +### [0.12.5](https://github.com/youzan/vant/tree/v0.12.5) +`2018-01-23` + +**Improvements** + +* Button: 新增 text 属性 [\#563](https://github.com/youzan/vant/pull/563) [@chenjiahan](https://github.com/chenjiahan) +* CouponList: 支持 v-model、exchangeButtonLoading、exchangeMinLength [\#556](https://github.com/youzan/vant/pull/556) [\#566](https://github.com/youzan/vant/pull/566) [@chenjiahan](https://github.com/chenjiahan) +* Icon: 更新 share 图标 [\#562](https://github.com/youzan/vant/pull/562) [@chenjiahan](https://github.com/chenjiahan) +* Sku: 优化渲染性能 [\#550](https://github.com/youzan/vant/pull/550) [@chenjiahan](https://github.com/chenjiahan) + +**Bug Fixes** +* Area: 修复未选中省份时市区展示错误的问题 [\#560](https://github.com/youzan/vant/pull/560) [@chenjiahan](https://github.com/chenjiahan) +* Cell: 修复 required 样式错误的问题 [\#553](https://github.com/youzan/vant/pull/553) [@qianzhaoy](https://github.com/qianzhaoy) + + ### [0.12.4](https://github.com/youzan/vant/tree/v0.12.4) `2018-01-18` From ca089ef04247e9c1ce52f37fcc0f1161c8cd8d0c Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 23 Jan 2018 19:59:15 +0800 Subject: [PATCH 13/49] [bugfix] Toast: work break (#567) --- packages/vant-css/src/toast.css | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vant-css/src/toast.css b/packages/vant-css/src/toast.css index e39dc8bb3..c5525ed13 100644 --- a/packages/vant-css/src/toast.css +++ b/packages/vant-css/src/toast.css @@ -10,6 +10,7 @@ font-size: 12px; line-height: 1.2; border-radius: 5px; + word-break: break-all; align-items: center; justify-content: center; flex-direction: column; From 1c8d77e466a5003ebe9a1dbb39595a434d35c9f3 Mon Sep 17 00:00:00 2001 From: niunai Date: Tue, 23 Jan 2018 20:15:25 +0800 Subject: [PATCH 14/49] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsku=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=96=87=E6=A1=88=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?sku-body-top=20slot=EF=BC=8C=E5=A2=9E=E5=8A=A0resetSelectedSkuO?= =?UTF-8?q?nHide=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/demos/mock/sku.js | 4 ++-- docs/demos/views/sku.vue | 1 + docs/markdown/en-US/sku.md | 3 +++ docs/markdown/zh-CN/sku.md | 3 +++ packages/sku/components/SkuStepper.vue | 1 + packages/sku/containers/SkuContainer.vue | 13 +++++++++++++ test/unit/specs/sku.spec.js | 3 ++- 7 files changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/demos/mock/sku.js b/docs/demos/mock/sku.js index 828a00312..5d5732349 100644 --- a/docs/demos/mock/sku.js +++ b/docs/demos/mock/sku.js @@ -366,7 +366,7 @@ export default { extend: null, kdt_id: 55, discount_price: 0, - stock_num: 6, + stock_num: 4, stock_mode: 0, is_sell: null, combin_sku: false, @@ -506,7 +506,7 @@ export default { alias: '2oml0r0n5vytj', quota: 15, is_virtual: '0', - quota_used: 0, + quota_used: 1, goods_info: { title: 'Goods Name', picture: 'https://img.yzcdn.cn/upload_files/2017/03/16/Fs_OMbSFPa183sBwvG_94llUYiLa.jpeg?imageView2/2/w/100/h/100/q/75/format/jpg', diff --git a/docs/demos/views/sku.vue b/docs/demos/views/sku.vue index 29e95078b..a930134fd 100644 --- a/docs/demos/views/sku.vue +++ b/docs/demos/views/sku.vue @@ -11,6 +11,7 @@ :quota="$t('sku').quota" :quota-used="$t('sku').quota_used" :reset-stepper-on-hide="true" + :reset-selected-sku-on-hide="true" :disable-stepper-input="true" @buy-clicked="handleBuyClicked" @add-cart="handleAddCartClicked" diff --git a/docs/markdown/en-US/sku.md b/docs/markdown/en-US/sku.md index 89e2fe8ff..41945a0ad 100644 --- a/docs/markdown/en-US/sku.md +++ b/docs/markdown/en-US/sku.md @@ -20,6 +20,7 @@ Vue.use(Sku); :quota="quota" :quota-used="quotaUsed" :reset-stepper-on-hide="resetStepperOnHide" + :reset-selected-sku-on-hide="resetSelectedSkuOnHide" :disable-stepper-input="disableStepperInput" @buy-clicked="handleBuyClicked" @add-cart="handleAddCartClicked" @@ -70,6 +71,7 @@ Vue.use(Sku); | quota | Quota (0 as no limit) | `Number` | `0` | - | | quota-used | Used quota | `Number` | `0` | - | | reset-stepper-on-hide | Whether to reset stepper when hide | `Boolean` | `false` | - | +| reset-selected-sku-on-hide | Whether to reset selected sku when hide | `Boolean` | `false` | - | | disable-stepper-input | Whether to disable stepper input | `Boolean` | `false` | - | | stepper-title | Quantity title | `String` | `Quantity` | - | @@ -85,6 +87,7 @@ Vue.use(Sku); | Name | Description | |-----------|-----------| | sku-header | Custom header | +| sku-body-top | Custom content before sku-group | | sku-group | Custom sku | | extra-sku-group | Extra custom content | | sku-stepper | Custom stepper | diff --git a/docs/markdown/zh-CN/sku.md b/docs/markdown/zh-CN/sku.md index 0993d4538..57c0895ef 100644 --- a/docs/markdown/zh-CN/sku.md +++ b/docs/markdown/zh-CN/sku.md @@ -20,6 +20,7 @@ Vue.use(Sku); :quota="quota" :quota-used="quotaUsed" :reset-stepper-on-hide="resetStepperOnHide" + :reset-selected-sku-on-hide="resetSelectedSkuOnHide" :disable-stepper-input="disableStepperInput" @buy-clicked="handleBuyClicked" @add-cart="handleAddCartClicked" @@ -71,6 +72,7 @@ Vue.use(Sku); | quota | 限购数(0表示不限购) | `Number` | `0` | - | | quota-used | 已经购买过的数量 | `Number` | `0` | - | | reset-stepper-on-hide | 窗口隐藏时重置选择的商品数量 | `Boolean` | `false` | - | +| reset-selected-sku-on-hide | 窗口隐藏时重置已选择的sku | `Boolean` | `false` | - | | disable-stepper-input | 是否禁用sku中stepper的input框 | `Boolean` | `false` | - | | stepper-title | 数量选择组件左侧文案 | `String` | `购买数量` | - | @@ -88,6 +90,7 @@ Sku 组件默认划分好了若干区块,这些区块都定义成了 slot, | 名称 | 说明 | |-----------|-----------| | sku-header | 商品信息展示区,包含商品图片、名称、价格等信息 | +| sku-body-top | sku展示区上方的slot,无默认展示内容,按需使用 | | sku-group | 商品sku展示区 | | extra-sku-group | 额外商品sku展示区,一般用不到 | | sku-stepper | 商品数量选择区 | diff --git a/packages/sku/components/SkuStepper.vue b/packages/sku/components/SkuStepper.vue index 9b7779355..9b2a1264c 100644 --- a/packages/sku/components/SkuStepper.vue +++ b/packages/sku/components/SkuStepper.vue @@ -86,6 +86,7 @@ export default create({ this.limitType = QUOTA_LIMIT; } else { limit = this.stock; + this.limitType = STOCK_LIMIT; } return limit; diff --git a/packages/sku/containers/SkuContainer.vue b/packages/sku/containers/SkuContainer.vue index a5c595d79..fb27be30a 100644 --- a/packages/sku/containers/SkuContainer.vue +++ b/packages/sku/containers/SkuContainer.vue @@ -2,6 +2,7 @@
+
+ + +
+ + +
+ { sku: data.sku, goodsId: data.goods_id, goods: goods, - resetStepperOnHide: true + resetStepperOnHide: true, + resetSelectedSkuOnHide: true } }); From e3ef5c853eda6230236e8df3cece51be3846aaac Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 24 Jan 2018 15:31:07 +0800 Subject: [PATCH 15/49] [bugfix] Tab: active not work (#572) --- packages/tabs/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tabs/index.vue b/packages/tabs/index.vue index 2e8cfab3b..ecf715702 100644 --- a/packages/tabs/index.vue +++ b/packages/tabs/index.vue @@ -75,7 +75,7 @@ export default create({ }, tabs(tabs) { - this.correctActive(this.curActive); + this.correctActive(this.curActive || this.active); this.setNavBar(); }, From 8f97bc9f0f9e2ee1a95a5e541fcd71143a92d2f3 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 24 Jan 2018 16:19:16 +0800 Subject: [PATCH 16/49] [Improvement] AddressEdit: add default slot (#573) --- docs/markdown/en-US/address-edit.md | 6 ++++++ docs/markdown/zh-CN/address-edit.md | 7 +++++++ docs/markdown/zh-CN/card.md | 2 +- docs/markdown/zh-CN/cell-swipe.md | 2 +- docs/markdown/zh-CN/cell.md | 2 +- docs/markdown/zh-CN/field.md | 2 +- docs/markdown/zh-CN/nav-bar.md | 2 +- docs/markdown/zh-CN/panel.md | 2 +- docs/markdown/zh-CN/pull-refresh.md | 2 +- docs/markdown/zh-CN/search.md | 2 +- docs/markdown/zh-CN/submit-bar.md | 2 +- docs/markdown/zh-CN/tag.md | 2 +- docs/markdown/zh-CN/uploader.md | 2 +- packages/address-edit/index.vue | 2 ++ 14 files changed, 26 insertions(+), 11 deletions(-) diff --git a/docs/markdown/en-US/address-edit.md b/docs/markdown/en-US/address-edit.md index 71e1a98c9..413621337 100644 --- a/docs/markdown/en-US/address-edit.md +++ b/docs/markdown/en-US/address-edit.md @@ -77,6 +77,12 @@ export default { | delete | Triggered when click delete | content:Form content | | change-detail | Triggered when address detail changed | value: address detail | +### Slot + +| Name | Description | +|-----------|-----------| +| - | Custom content below postal | + ### Data Structure #### addressInfo Data Structure diff --git a/docs/markdown/zh-CN/address-edit.md b/docs/markdown/zh-CN/address-edit.md index 8fcdf504f..284da50e8 100644 --- a/docs/markdown/zh-CN/address-edit.md +++ b/docs/markdown/zh-CN/address-edit.md @@ -79,6 +79,13 @@ export default { | change-area | 修改收件地区时触发 | values: 地区信息 | | change-detail | 修改详细地址时触发 | value: 详细地址内容 | +### Slot + +| 名称 | 说明 | +|-----------|-----------| +| - | 在邮政编码下方插入内容 | + + ### 数据格式 #### addressInfo 数据格式 diff --git a/docs/markdown/zh-CN/card.md b/docs/markdown/zh-CN/card.md index f36281182..a2897874c 100644 --- a/docs/markdown/zh-CN/card.md +++ b/docs/markdown/zh-CN/card.md @@ -52,7 +52,7 @@ Vue.use(Card); ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | title | 自定义标题 | | desc | 自定义描述 | diff --git a/docs/markdown/zh-CN/cell-swipe.md b/docs/markdown/zh-CN/cell-swipe.md index 63c3bfa4f..8e30f8ed6 100644 --- a/docs/markdown/zh-CN/cell-swipe.md +++ b/docs/markdown/zh-CN/cell-swipe.md @@ -66,7 +66,7 @@ export default { ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | - | 自定义显示内容 | | left | 左侧滑动内容 | diff --git a/docs/markdown/zh-CN/cell.md b/docs/markdown/zh-CN/cell.md index a351adc89..5bc62dcd2 100644 --- a/docs/markdown/zh-CN/cell.md +++ b/docs/markdown/zh-CN/cell.md @@ -92,7 +92,7 @@ Vue.use(CellGroup); ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | - | 自定义显示内容 | | icon | 自定义`icon` | diff --git a/docs/markdown/zh-CN/field.md b/docs/markdown/zh-CN/field.md index 922e0d6ba..65598c120 100644 --- a/docs/markdown/zh-CN/field.md +++ b/docs/markdown/zh-CN/field.md @@ -113,6 +113,6 @@ Filed 默认支持 Input 标签所有的原生事件,如 `focus`、`blur`、`k ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | icon | 自定义icon | diff --git a/docs/markdown/zh-CN/nav-bar.md b/docs/markdown/zh-CN/nav-bar.md index d9d00a927..dc5327156 100644 --- a/docs/markdown/zh-CN/nav-bar.md +++ b/docs/markdown/zh-CN/nav-bar.md @@ -57,7 +57,7 @@ export default { ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | title | 自定义标题 | | left | 自定义左侧区域内容 | diff --git a/docs/markdown/zh-CN/panel.md b/docs/markdown/zh-CN/panel.md index 7eb4e3dc4..029e909c1 100644 --- a/docs/markdown/zh-CN/panel.md +++ b/docs/markdown/zh-CN/panel.md @@ -41,7 +41,7 @@ Vue.use(Panel); ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | - | 自定义内容 | | header | 自定义 header | diff --git a/docs/markdown/zh-CN/pull-refresh.md b/docs/markdown/zh-CN/pull-refresh.md index d508df63a..9bac4f7f3 100644 --- a/docs/markdown/zh-CN/pull-refresh.md +++ b/docs/markdown/zh-CN/pull-refresh.md @@ -52,7 +52,7 @@ export default { ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | - | 自定义内容 | | normal | 非下拉状态时顶部内容 | diff --git a/docs/markdown/zh-CN/search.md b/docs/markdown/zh-CN/search.md index c8344776c..cf72388e8 100644 --- a/docs/markdown/zh-CN/search.md +++ b/docs/markdown/zh-CN/search.md @@ -64,6 +64,6 @@ Search 默认支持 Input 标签所有的原生事件,如 `focus`、`blur`、` ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | action | 自定义搜索框右侧按钮,需要在`showAction`为 true 时才会显示 | diff --git a/docs/markdown/zh-CN/submit-bar.md b/docs/markdown/zh-CN/submit-bar.md index fdbba9730..f412c5a8e 100644 --- a/docs/markdown/zh-CN/submit-bar.md +++ b/docs/markdown/zh-CN/submit-bar.md @@ -80,7 +80,7 @@ Vue.use(SubmitBar); ### Slot -| Name | 说明 | +| 名称 | 说明 | |-----------|-----------| | default | 自定义订单栏左侧内容 | | tip | 提示文案中的额外操作和说明 | diff --git a/docs/markdown/zh-CN/tag.md b/docs/markdown/zh-CN/tag.md index 3d6879961..f505ba812 100644 --- a/docs/markdown/zh-CN/tag.md +++ b/docs/markdown/zh-CN/tag.md @@ -49,6 +49,6 @@ Vue.use(Tag); ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | - | 自定义 Tag 显示内容 | diff --git a/docs/markdown/zh-CN/uploader.md b/docs/markdown/zh-CN/uploader.md index 6e93da559..937db1670 100644 --- a/docs/markdown/zh-CN/uploader.md +++ b/docs/markdown/zh-CN/uploader.md @@ -47,6 +47,6 @@ export default { ### Slot -| name | 描述 | +| 名称 | 说明 | |-----------|-----------| | - | 自定义上传显示图标 | diff --git a/packages/address-edit/index.vue b/packages/address-edit/index.vue index 86ae309cc..236fbc133 100644 --- a/packages/address-edit/index.vue +++ b/packages/address-edit/index.vue @@ -44,6 +44,7 @@ :error="errorInfo.postal_code" @focus="onFocus('postal_code')" /> + Date: Wed, 24 Jan 2018 20:28:53 +0800 Subject: [PATCH 17/49] [new feature] Uploader: support maxSize prop (#575) --- docs/demos/views/uploader.vue | 4 ++-- docs/markdown/en-US/uploader.md | 23 ++++++++++++++++----- docs/markdown/zh-CN/uploader.md | 23 ++++++++++++++++----- packages/uploader/index.vue | 34 ++++++++++++++++++++++++-------- test/unit/specs/uploader.spec.js | 33 +++++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+), 20 deletions(-) diff --git a/docs/demos/views/uploader.vue b/docs/demos/views/uploader.vue index f632001f7..7cb9b6deb 100644 --- a/docs/demos/views/uploader.vue +++ b/docs/demos/views/uploader.vue @@ -2,7 +2,7 @@
- +
@@ -10,7 +10,7 @@
- +
diff --git a/docs/markdown/en-US/uploader.md b/docs/markdown/en-US/uploader.md index 49d7c26e2..ae07f0115 100644 --- a/docs/markdown/en-US/uploader.md +++ b/docs/markdown/en-US/uploader.md @@ -42,13 +42,26 @@ You can set native properties such as `accpet`、`multiple` on Uploader, and the | Attribute | Description | Type | Default | Accepted Values | |-----------|-----------|-----------|-------------|-------------| -| result-type | The way to read the file, read as base64; read as text | `String` | `dataUrl` | `text` | -| disable | Whether to disable the upload, set to true during the image upload to prevent users from clicking this component to upload pictures | `Boolean` | `false` | - | -| before-read | Hook before reading the file, the first parameter is the selected file, return false to stop reading the file | `Function` | - | - | -| after-read | Hook after reading the file, parameter format: { file ,content } | `Function` | - | - | +| result-type | Type of file read result | `String` | `dataUrl` | `text` | +| disable | Whether to disable the upload | `Boolean` | `false` | - | +| before-read | Hook before reading the file, return false to stop reading the file | `Function` | - | - | +| after-read | Hook after reading the file | `Function` | - | - | +| max-size | Max size of file | `Number` | - | - | + +### Event + +| Event | Description | Arguments | +|-----------|-----------|-----------| +| oversize | Triggered when file size over limit | Same as after-read | ### Slot -| name | Description | +| Name | Description | |-----------|-----------| | - | Custom icon | + +### afterRead parematers +| Key | Description | Type | +|-----------|-----------|-----------| +| file | file object | `Object` | +| content | file content | `String` | \ No newline at end of file diff --git a/docs/markdown/zh-CN/uploader.md b/docs/markdown/zh-CN/uploader.md index 937db1670..b9247e0c5 100644 --- a/docs/markdown/zh-CN/uploader.md +++ b/docs/markdown/zh-CN/uploader.md @@ -40,13 +40,26 @@ export default { | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| result-type | 读取文件的方式,以base64的方式读取;以文本的方式读取 | `String` | `dataUrl` | `text` | -| disable | 是否禁用上传,在图片上传期间设置为true,禁止用户点击此组件上传图片 | `Boolean` | `false` | - | -| before-read | 读文件之前的钩子,参数为选择的文件,若返回 false 则停止读取文件 | `Function` | - | - | -| after-read | 文件读完之后回调此函数,参数为 { file:'选择的文件',content:'读的内容' } | `Function` | - | - | +| result-type | 文件读取结果类型 | `String` | `dataUrl` | `text` | +| disable | 是否禁用图片上传 | `Boolean` | `false` | - | +| before-read | 读取前的回调函数,返回 false 可终止文件读取 | `Function` | - | - | +| after-read | 读取完成后的回调函数 | `Function` | - | - | +| max-size | 文件大小限制,单位为 byte | `Number` | - | - | + +### Event + +| 事件名 | 说明 | 参数 | +|-----------|-----------|-----------| +| oversize | 文件大小超过限制时触发 | 同 after-read | ### Slot | 名称 | 说明 | |-----------|-----------| -| - | 自定义上传显示图标 | +| - | 自定义 uploader 内容 | + +### afterRead 回调参数 +| key | 说明 | 类型 | +|-----------|-----------|-----------| +| file | 文件解析后的 file 对象 | `Object` | +| content | 文件内容 | `String` | \ No newline at end of file diff --git a/packages/uploader/index.vue b/packages/uploader/index.vue index a5def7183..78530c31d 100644 --- a/packages/uploader/index.vue +++ b/packages/uploader/index.vue @@ -27,6 +27,10 @@ export default create({ resultType: { type: String, default: 'dataUrl' + }, + maxSize: { + type: Number, + default: Number.MAX_VALUE } }, @@ -44,16 +48,26 @@ export default create({ if (Array.isArray(files)) { Promise.all(files.map(this.readFile)).then(contents => { - this.onAfterRead( - files.map((file, index) => ({ + let oversize = false; + const payload = files.map((file, index) => { + if (file.size > this.maxSize) { + oversize = true; + } + + return { file: files[index], content: contents[index] - })) - ); + }; + }); + + this.onAfterRead(payload, oversize); }); } else { this.readFile(files).then(content => { - this.onAfterRead({ file: files, content }); + this.onAfterRead( + { file: files, content }, + files.size > this.maxSize + ); }); } }, @@ -74,9 +88,13 @@ export default create({ }); }, - onAfterRead(file) { - this.afterRead && this.afterRead(file); - this.$refs.input && (this.$refs.input.value = ''); + onAfterRead(files, oversize) { + if (oversize) { + this.$emit('oversize', files); + } else { + this.afterRead && this.afterRead(files); + this.$refs.input && (this.$refs.input.value = ''); + } } } }); diff --git a/test/unit/specs/uploader.spec.js b/test/unit/specs/uploader.spec.js index ea1be0a7f..6d3648a49 100644 --- a/test/unit/specs/uploader.spec.js +++ b/test/unit/specs/uploader.spec.js @@ -3,6 +3,7 @@ import { mount } from 'avoriaz'; window.File = function() { this.name = 'test'; + this.size = 10000; }; window.FileReader = function() { @@ -101,4 +102,36 @@ describe('Uploader', () => { wrapper.vm.onChange({ target: { files: [mockFile, mockFile] }}); }); + + it('size overlimit', done => { + const spy = sinon.spy(); + wrapper = mount(Uploader, { + propsData: { + maxSize: 1 + } + }); + wrapper.vm.$on('oversize', spy); + wrapper.vm.onChange({ target: { files: [mockFile] }}); + + setTimeout(() => { + expect(spy.calledOnce).to.be.true; + done(); + }, 50); + }); + + it('multi file size overlimit', done => { + const spy = sinon.spy(); + wrapper = mount(Uploader, { + propsData: { + maxSize: 1 + } + }); + wrapper.vm.$on('oversize', spy); + wrapper.vm.onChange({ target: { files: [mockFile, mockFile] }}); + + setTimeout(() => { + expect(spy.calledOnce).to.be.true; + done(); + }, 50); + }); }); From a59f8bedf276ba361b9fe8de7bb6254fa9221aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 25 Jan 2018 10:48:50 +0800 Subject: [PATCH 18/49] [build] 0.12.6 --- packages/index.js | 2 +- packages/vant-css/package-lock.json | 2 +- packages/vant-css/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/index.js b/packages/index.js index 2a7c59799..bda454c34 100644 --- a/packages/index.js +++ b/packages/index.js @@ -62,7 +62,7 @@ import TreeSelect from './tree-select'; import Uploader from './uploader'; import Waterfall from './waterfall'; -const version = '0.12.5'; +const version = '0.12.6'; const components = [ Actionsheet, AddressEdit, diff --git a/packages/vant-css/package-lock.json b/packages/vant-css/package-lock.json index 41cef9cdf..723f86319 100644 --- a/packages/vant-css/package-lock.json +++ b/packages/vant-css/package-lock.json @@ -1,6 +1,6 @@ { "name": "vant-css", - "version": "0.12.5", + "version": "0.12.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/vant-css/package.json b/packages/vant-css/package.json index a46b94fca..50809879d 100644 --- a/packages/vant-css/package.json +++ b/packages/vant-css/package.json @@ -1,6 +1,6 @@ { "name": "vant-css", - "version": "0.12.5", + "version": "0.12.6", "description": "vant css.", "main": "lib/index.css", "style": "lib/index.css", From 23b167b1510b5b1f115a4b8616dec75fe94b7f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 25 Jan 2018 10:48:51 +0800 Subject: [PATCH 19/49] [release] 0.12.6 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 289c23cbb..94ca406de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "0.12.5", + "version": "0.12.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a289dfa7c..c5bf520d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "0.12.5", + "version": "0.12.6", "description": "A Vue.js 2.0 Mobile UI at YouZan", "main": "lib/vant.js", "style": "lib/vant-css/index.css", From fab548d4e22226a3577588b3645c8632ba5320b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 25 Jan 2018 11:00:54 +0800 Subject: [PATCH 20/49] [changelog] 0.12.6 --- docs/markdown/en-US/changelog.md | 14 ++++++++++++++ docs/markdown/zh-CN/changelog-generated.md | 16 ++++++++++++++++ docs/markdown/zh-CN/changelog.md | 16 ++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/docs/markdown/en-US/changelog.md b/docs/markdown/en-US/changelog.md index 017725342..bac6685b2 100644 --- a/docs/markdown/en-US/changelog.md +++ b/docs/markdown/en-US/changelog.md @@ -1,5 +1,19 @@ ## Changelog +### [0.12.6](https://github.com/youzan/vant/tree/v0.12.6) +`2018-01-25` + +**Improvements** + +* AddressEdit: add default slot [\#573](https://github.com/youzan/vant/pull/573) [@chenjiahan](https://github.com/chenjiahan) +* Uploader: support maxSize prop [\#575](https://github.com/youzan/vant/pull/575) [@chenjiahan](https://github.com/chenjiahan) +* Sku: add sku-body-top slot and resetSelectedSkuOnHide prop [\#568](https://github.com/youzan/vant/pull/568) [@w91](https://github.com/w91) + +**Bug Fixes** + +* fix Sku message error when overlimit [\#568](https://github.com/youzan/vant/pull/568) [@w91](https://github.com/w91) +* fix Toast work break [\#567](https://github.com/youzan/vant/pull/567) [@chenjiahan](https://github.com/chenjiahan) +* fix Tab active not work [\#572](https://github.com/youzan/vant/pull/572) [@chenjiahan](https://github.com/chenjiahan) ### [0.12.5](https://github.com/youzan/vant/tree/v0.12.5) `2018-01-23` diff --git a/docs/markdown/zh-CN/changelog-generated.md b/docs/markdown/zh-CN/changelog-generated.md index fae164c9d..fca6b8965 100644 --- a/docs/markdown/zh-CN/changelog-generated.md +++ b/docs/markdown/zh-CN/changelog-generated.md @@ -1,5 +1,21 @@ ## 更新日志 +## [v0.12.6](https://github.com/youzan/vant/tree/v0.12.6) (2018-01-25) +[Full Changelog](https://github.com/youzan/vant/compare/v0.12.5...v0.12.6) + +**Issue** + +- 能否去除cell的下边框线 [\#576](https://github.com/youzan/vant/issues/576) +- 地址编辑 areaList 请求后 赋值不可以? [\#570](https://github.com/youzan/vant/issues/570) + +**Improvements** + +- \[new feature\] Uploader: support maxSize prop [\#575](https://github.com/youzan/vant/pull/575) ([chenjiahan](https://github.com/chenjiahan)) +- \[Improvement\] AddressEdit: add default slot [\#573](https://github.com/youzan/vant/pull/573) ([chenjiahan](https://github.com/chenjiahan)) +- \[bugfix\] Tab: active not work [\#572](https://github.com/youzan/vant/pull/572) ([chenjiahan](https://github.com/chenjiahan)) +- \[bugfix\] 修复限购情况下,未超出限购数时的错误文案显示;\[new feature\] 增加sku-body-top slot;\[new feature\] 增加resetSelectedSkuOnHide参数 [\#568](https://github.com/youzan/vant/pull/568) ([w91](https://github.com/w91)) +- \[bugfix\] Toast: work break [\#567](https://github.com/youzan/vant/pull/567) ([chenjiahan](https://github.com/chenjiahan)) + ## [v0.12.5](https://github.com/youzan/vant/tree/v0.12.5) (2018-01-23) [Full Changelog](https://github.com/youzan/vant/compare/v0.12.4...v0.12.5) diff --git a/docs/markdown/zh-CN/changelog.md b/docs/markdown/zh-CN/changelog.md index fe2207b67..4257cc650 100644 --- a/docs/markdown/zh-CN/changelog.md +++ b/docs/markdown/zh-CN/changelog.md @@ -1,5 +1,21 @@ ## 更新日志 +### [0.12.6](https://github.com/youzan/vant/tree/v0.12.6) +`2018-01-25` + +**Improvements** + +- AddressEdit: 增加默认 slot [\#573](https://github.com/youzan/vant/pull/573) [@chenjiahan](https://github.com/chenjiahan) +- Uploader: 新增 maxSize 属性 [\#575](https://github.com/youzan/vant/pull/575) [@chenjiahan](https://github.com/chenjiahan) +- Sku: 新增 sku-body-top slot、resetSelectedSkuOnHide 属性 [\#568](https://github.com/youzan/vant/pull/568) [@w91](https://github.com/w91) + +**Bug Fixes** + +- 修复 Toast 文案换行 [\#567](https://github.com/youzan/vant/pull/567) [@chenjiahan](https://github.com/chenjiahan) +- 修复 Sku 限购情况下,未超出限购数时的错误文案显示 [\#568](https://github.com/youzan/vant/pull/568) [@w91](https://github.com/w91) +- 修复 Tab active 在初始化时未生效的问题 [\#572](https://github.com/youzan/vant/pull/572) [@chenjiahan](https://github.com/chenjiahan) + + ### [0.12.5](https://github.com/youzan/vant/tree/v0.12.5) `2018-01-23` From 094cc978344d94fb183b3de1f3aa1fe6f620fe10 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 29 Jan 2018 10:52:26 +0800 Subject: [PATCH 21/49] [bugfix] Field: multi line label stye error (#583) --- package.json | 6 +++--- packages/vant-css/src/field.css | 8 -------- yarn.lock | 25 ++++++++++++++++--------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index c5bf520d0..49852add3 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "css-loader": "^0.28.9", "dependency-tree": "^6.0.0", "eslint": "^4.16.0", - "eslint-plugin-vue": "^4.2.0", + "eslint-plugin-vue": "^4.2.2", "extract-text-webpack-plugin": "3.0.2", "fast-vue-md-loader": "^1.0.3", "friendly-errors-webpack-plugin": "^1.6.1", @@ -92,7 +92,7 @@ "shelljs": "^0.8.1", "sinon": "^2.4.1", "sinon-chai": "^2.12.0", - "style-loader": "^0.19.1", + "style-loader": "^0.20.1", "uppercamelcase": "^3.0.0", "url-loader": "^0.6.2", "vant-doc": "1.0.2", @@ -100,7 +100,7 @@ "vue-loader": "^13.7.0", "vue-router": "^3.0.1", "vue-sfc-compiler": "^0.0.8", - "vue-style-loader": "^3.0.0", + "vue-style-loader": "^3.1.1", "vue-template-compiler": "^2.5.13", "vue-template-es2015-compiler": "^1.6.0", "webpack": "^3.10.0", diff --git a/packages/vant-css/src/field.css b/packages/vant-css/src/field.css index 977ea4aa5..f5812aab7 100644 --- a/packages/vant-css/src/field.css +++ b/packages/vant-css/src/field.css @@ -5,14 +5,6 @@ .van-cell__title { width: 90px; - position: absolute; - top: 10px; - left: 15px; - } - - .van-cell__value { - width: 100%; - padding-left: 90px; } &__error-message { diff --git a/yarn.lock b/yarn.lock index d31cba799..9c19d8ddc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2358,9 +2358,9 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-plugin-vue@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-4.2.0.tgz#25fade387bf9a97377cf0e5cd17ef0d60ac9da57" +eslint-plugin-vue@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-4.2.2.tgz#63e55c61574af8ef983328ddd2688d6389a0214b" dependencies: vue-eslint-parser "^2.0.1" @@ -6124,7 +6124,7 @@ schema-utils@^0.3.0: dependencies: ajv "^5.0.0" -schema-utils@^0.4.2: +schema-utils@^0.4.2, schema-utils@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.3.tgz#e2a594d3395834d5e15da22b48be13517859458e" dependencies: @@ -6623,12 +6623,12 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -style-loader@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.1.tgz#591ffc80bcefe268b77c5d9ebc0505d772619f85" +style-loader@^0.20.1: + version "0.20.1" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.20.1.tgz#33ac2bf4d5c65a8906bc586ad253334c246998d0" dependencies: - loader-utils "^1.0.2" - schema-utils "^0.3.0" + loader-utils "^1.1.0" + schema-utils "^0.4.3" stylus-lookup@^1.0.1: version "1.0.2" @@ -7154,6 +7154,13 @@ vue-style-loader@^3.0.0: hash-sum "^1.0.2" loader-utils "^1.0.2" +vue-style-loader@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-3.1.1.tgz#74fdef91a81d38bc0125746a1b5505e62d69e32c" + dependencies: + hash-sum "^1.0.2" + loader-utils "^1.0.2" + vue-template-compiler@^2.5.13: version "2.5.13" resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.13.tgz#12a2aa0ecd6158ac5e5f14d294b0993f399c3d38" From 7f055a4d2d471728974965f3636c663afda8eb69 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 29 Jan 2018 14:39:42 +0800 Subject: [PATCH 22/49] [Improvement] Sku: add getSkuData method (#585) --- docs/demos/views/sku.vue | 25 ++++++++++++------------ docs/markdown/en-US/sku.md | 18 ++++++++++------- docs/markdown/zh-CN/sku.md | 19 ++++++++++-------- packages/sku/Sku.vue | 40 +++++++++++++++++++++----------------- 4 files changed, 57 insertions(+), 45 deletions(-) diff --git a/docs/demos/views/sku.vue b/docs/demos/views/sku.vue index a930134fd..97bc35520 100644 --- a/docs/demos/views/sku.vue +++ b/docs/demos/views/sku.vue @@ -13,8 +13,8 @@ :reset-stepper-on-hide="true" :reset-selected-sku-on-hide="true" :disable-stepper-input="true" - @buy-clicked="handleBuyClicked" - @add-cart="handleAddCartClicked" + @buy-clicked="onBuyClicked" + @add-cart="onAddCartClicked" /> {{ $t('basicUsage') }}
@@ -23,7 +23,7 @@
-
@@ -49,6 +49,10 @@ export default create({ computed: { displayStyle() { return STYLE_LIST.indexOf(this.type) !== -1 ? 'default' : this.type; + }, + + hasMessage() { + return this.message || this.message === 0; } } }); diff --git a/packages/vant-css/src/button.css b/packages/vant-css/src/button.css index d55aa67b0..ef92beafb 100644 --- a/packages/vant-css/src/button.css +++ b/packages/vant-css/src/button.css @@ -31,10 +31,6 @@ opacity: .3; } - &__icon-loading { - display: inline-block; - } - &--default { color: $button-default-color; background-color: $button-default-background-color; diff --git a/packages/vant-css/src/switch.css b/packages/vant-css/src/switch.css index 746b81e52..a1341b945 100644 --- a/packages/vant-css/src/switch.css +++ b/packages/vant-css/src/switch.css @@ -30,13 +30,11 @@ } &__loading { + top: 50%; + left: 50%; width: 16px; height: 16px; - position: relative; - left: 50%; - top: 50%; transform: translate3d(-50%, -50%, 0); - margin: 0; } &--on { From c2773b49a6bbb95097a9870a0d07e1e4cf02262e Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 8 Feb 2018 10:07:00 +0800 Subject: [PATCH 46/49] [Improvement] Circle: optimzie linecap (#624) --- packages/circle/index.vue | 2 +- packages/vant-css/src/circle.css | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/circle/index.vue b/packages/circle/index.vue index 1040124da..6bd78cc92 100644 --- a/packages/circle/index.vue +++ b/packages/circle/index.vue @@ -52,7 +52,7 @@ export default create({ }, beforeCreate() { - this.perimeter = Math.PI * 1000; + this.perimeter = 3140; this.path = 'M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0'; }, diff --git a/packages/vant-css/src/circle.css b/packages/vant-css/src/circle.css index d4c777616..d0159c417 100644 --- a/packages/vant-css/src/circle.css +++ b/packages/vant-css/src/circle.css @@ -15,6 +15,7 @@ &__layer { fill: none; + stroke-linecap: round; stroke-dasharray: 3140; stroke-dashoffset: 3140; transform: rotate(90deg); From 6ed43f8c757828f9ff6f735e3c8fa35feee17916 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 8 Feb 2018 10:38:34 +0800 Subject: [PATCH 47/49] [Improvement] PullRefresh: add refersh event (#625) --- docs/demos/views/pull-refresh.vue | 24 ++++++++--------- docs/markdown/en-US/pull-refresh.md | 40 +++++++++++++++------------- docs/markdown/zh-CN/pull-refresh.md | 28 +++++++++++-------- packages/pull-refresh/index.vue | 1 + test/unit/specs/pull-refresh.spec.js | 4 +++ 5 files changed, 55 insertions(+), 42 deletions(-) diff --git a/docs/demos/views/pull-refresh.vue b/docs/demos/views/pull-refresh.vue index 0b3084ead..b28a10dc8 100644 --- a/docs/demos/views/pull-refresh.vue +++ b/docs/demos/views/pull-refresh.vue @@ -1,5 +1,5 @@