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/13] [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/13] [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/13] [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/13] [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/13] [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/13] [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/13] [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/13] [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;