From 56c7cc0efc34361b99d1ca30698045e746547a81 Mon Sep 17 00:00:00 2001 From: vanppo Date: Mon, 26 Mar 2018 20:09:18 +0800 Subject: [PATCH 01/20] Add new props 'childrenKey' to Tree component --- src/components/tree/node.vue | 20 ++++++++++++++------ src/components/tree/tree.vue | 7 ++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/tree/node.vue b/src/components/tree/node.vue index 21e6620d..2029bba9 100644 --- a/src/components/tree/node.vue +++ b/src/components/tree/node.vue @@ -17,11 +17,12 @@ {{ data.title }} + :show-checkbox="showCheckbox" + :children-key="childrenKey"> @@ -52,6 +53,10 @@ type: Boolean, default: false }, + childrenKey: { + type: String, + default: 'children' + }, showCheckbox: { type: Boolean, default: false @@ -93,7 +98,7 @@ ]; }, showArrow () { - return (this.data.children && this.data.children.length) || ('loading' in this.data && !this.data.loading); + return (this.data[this.childrenKey] && this.data[this.childrenKey].length) || ('loading' in this.data && !this.data.loading); }, showLoading () { return 'loading' in this.data && this.data.loading; @@ -118,6 +123,9 @@ } else { return []; } + }, + children () { + return this.data[this.childrenKey]; } }, methods: { @@ -126,14 +134,14 @@ if (item.disabled) return; // async loading - if (item.children.length === 0) { + if (item[this.childrenKey].length === 0) { const tree = findComponentUpward(this, 'Tree'); if (tree && tree.loadData) { this.$set(this.data, 'loading', true); tree.loadData(item, children => { this.$set(this.data, 'loading', false); if (children.length) { - this.$set(this.data, 'children', children); + this.$set(this.data, this.childrenKey, children); this.$nextTick(() => this.handleExpand()); } }); @@ -141,7 +149,7 @@ } } - if (item.children && item.children.length) { + if (item[this.childrenKey] && item[this.childrenKey].length) { this.$set(this.data, 'expand', !this.data.expand); this.dispatch('Tree', 'toggle-expand', this.data); } diff --git a/src/components/tree/tree.vue b/src/components/tree/tree.vue index 1da8e2f1..ac4c3814 100644 --- a/src/components/tree/tree.vue +++ b/src/components/tree/tree.vue @@ -6,7 +6,8 @@ :data="item" visible :multiple="multiple" - :show-checkbox="showCheckbox"> + :show-checkbox="showCheckbox" + :children-key="childrenKey">
{{ localeEmptyText }}
@@ -40,6 +41,10 @@ emptyText: { type: String }, + childrenKey: { + type: String, + default: 'children' + }, loadData: { type: Function }, From d45d2ee06125dff2b986bdceffb5bcb8785a325f Mon Sep 17 00:00:00 2001 From: Aresn Date: Wed, 28 Mar 2018 10:49:24 +0800 Subject: [PATCH 02/20] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d3332e79..85afcb54 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,8 @@ If you want to contribute or have questions or bugs to report: |---|---|---|---|---|---| |[Aresn](https://github.com/icarusion) | ![](https://avatars3.githubusercontent.com/u/5370542?v=3&s=60) |[jingsam](https://github.com/jingsam) | ![](https://avatars3.githubusercontent.com/u/1522494?v=3&s=60) | [rijn](https://github.com/rijn) | ![](https://avatars2.githubusercontent.com/u/6976367?v=3&s=60) | |[lcx960324](https://github.com/lcx960324) | ![](https://avatars3.githubusercontent.com/u/9768245?v=3&s=60) |[GITleonine1989](https://github.com/GITleonine1989) | ![](https://avatars1.githubusercontent.com/u/7582490?v=3&s=60) |[huixisheng](https://github.com/huixisheng) | ![](https://avatars1.githubusercontent.com/u/1518967?v=3&s=60) | -|[Sergio Crisostomo](https://github.com/SergioCrisostomo) | ![](https://avatars3.githubusercontent.com/u/5614559?v=3&s=60) | [lison16](https://github.com/lison16) | ![](https://avatars3.githubusercontent.com/u/20942571?v=3&s=60) | [Xotic750](https://github.com/Xotic750) | ![](https://avatars3.githubusercontent.com/u/216041?v=3&s=60) +|[Sergio Crisostomo](https://github.com/SergioCrisostomo) | ![](https://avatars3.githubusercontent.com/u/5614559?v=3&s=60) | [lison16](https://github.com/lison16) | ![](https://avatars3.githubusercontent.com/u/20942571?v=3&s=60) | [Xotic750](https://github.com/Xotic750) | ![](https://avatars3.githubusercontent.com/u/216041?v=3&s=60) | +[huanghong1125](https://github.com/huanghong1125) | ![](https://avatars3.githubusercontent.com/u/12794817?v=3&s=60) | ## Links From 82da254366fb823dd7ebaa0e85c4eb8b78b367ff Mon Sep 17 00:00:00 2001 From: huangrd Date: Wed, 28 Mar 2018 16:00:52 +0800 Subject: [PATCH 03/20] Fixed #2931 --- src/styles/components/select.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/styles/components/select.less b/src/styles/components/select.less index fe860cab..adb6c6ef 100644 --- a/src/styles/components/select.less +++ b/src/styles/components/select.less @@ -236,6 +236,8 @@ } &-dropdown-list { + display: inline-block; + min-width: 100%; list-style: none; } } From 4e31085656024415d21d3e4955ca3f590cde48fe Mon Sep 17 00:00:00 2001 From: BillyWang <181347204@qq.com> Date: Wed, 28 Mar 2018 22:42:16 +0800 Subject: [PATCH 04/20] =?UTF-8?q?*=20=E9=87=87=E7=94=A8inject=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E4=BF=AE=E6=AD=A3=E9=97=AE=E9=A2=98=EF=BC=9A?= =?UTF-8?q?=E5=BD=93FormItem=E7=BB=84=E4=BB=B6=E5=9C=A8slot=E9=87=8C?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=97=A0=E6=B3=95=E6=AD=A3=E7=A1=AE=E8=8E=B7?= =?UTF-8?q?=E5=8F=96form=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/form/form-item.vue | 15 ++++++++------- src/components/form/form.vue | 3 +++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/form/form-item.vue b/src/components/form/form-item.vue index 17fb9885..1fc20196 100644 --- a/src/components/form/form-item.vue +++ b/src/components/form/form-item.vue @@ -92,6 +92,7 @@ this.validateState = val; } }, + inject: ['form'], computed: { classes () { return [ @@ -103,13 +104,13 @@ } ]; }, - form() { - let parent = this.$parent; - while (parent.$options.name !== 'iForm') { - parent = parent.$parent; - } - return parent; - }, + // form() { + // let parent = this.$parent; + // while (parent.$options.name !== 'iForm') { + // parent = parent.$parent; + // } + // return parent; + // }, fieldValue: { cache: false, get() { diff --git a/src/components/form/form.vue b/src/components/form/form.vue index 477b08fb..57b284a2 100644 --- a/src/components/form/form.vue +++ b/src/components/form/form.vue @@ -40,6 +40,9 @@ default: 'off' } }, + provide() { + return { form : this }; + }, data () { return { fields: [] From 9b7e32b507e016a589850e71498b1feb38368cb9 Mon Sep 17 00:00:00 2001 From: BillyWang <181347204@qq.com> Date: Wed, 28 Mar 2018 22:47:10 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E9=87=87=E7=94=A8=20findComponentUpward?= =?UTF-8?q?=20=E6=9B=BF=E4=BB=A3=20this.$parent.$parent.$parent=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=20Dropdown=20=E7=88=B6=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dropdown/dropdown-item.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/dropdown/dropdown-item.vue b/src/components/dropdown/dropdown-item.vue index 0bd902c0..494c6585 100644 --- a/src/components/dropdown/dropdown-item.vue +++ b/src/components/dropdown/dropdown-item.vue @@ -3,7 +3,7 @@ diff --git a/src/components/menu/menu.vue b/src/components/menu/menu.vue index 187859a7..e5b5abef 100644 --- a/src/components/menu/menu.vue +++ b/src/components/menu/menu.vue @@ -43,7 +43,8 @@ }, data () { return { - currentActiveName: this.activeName + currentActiveName: this.activeName, + openedNames: [] }; }, computed: { @@ -76,36 +77,40 @@ this.broadcast('MenuItem', 'on-update-active-name', this.currentActiveName); }, updateOpenKeys (name) { - const index = this.openNames.indexOf(name); - if (index > -1) { - this.openNames.splice(index, 1); + let names = [...this.openedNames]; + const index = names.indexOf(name); + if (index >= 0) { + names.splice(index, 1); } else { - this.openNames.push(name); if (this.accordion) { - let currentSubmenu = {}; + let currentSubmenu = null; findComponentsDownward(this, 'Submenu').forEach(item => { if (item.name === name) currentSubmenu = item; }); findBrothersComponents(currentSubmenu, 'Submenu').forEach(item => { - let index = this.openNames.indexOf(item.name); - this.openNames.splice(index, index >= 0 ? 1 : 0); + let i = names.indexOf(item.name); + if (i >= 0) names.splice(i, 1); }); - this.openNames.push(name); + names.push(name); } } + this.openedNames = names; + this.$emit('on-open-change', this.openedNames); }, updateOpened () { const items = findComponentsDownward(this, 'Submenu'); if (items.length) { items.forEach(item => { - if (this.openNames.indexOf(item.name) > -1) item.opened = true; + if (this.openedNames.indexOf(item.name) > -1) item.opened = true; + else item.opened = false; }); } } }, mounted () { this.updateActiveName(); + this.openedNames = [...this.openNames]; this.updateOpened(); this.$on('on-menu-item-select', (name) => { this.currentActiveName = name; @@ -113,8 +118,8 @@ }); }, watch: { - openNames () { - this.$emit('on-open-change', this.openNames); + openNames (names) { + this.openedNames = names; }, activeName (val) { this.currentActiveName = val; From e99172bb2b9fc619738c60686330ecff35328557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Wed, 4 Apr 2018 14:23:37 +0800 Subject: [PATCH 17/20] publish 2.12.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e4829cc8..04905807 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iview", - "version": "2.11.0", + "version": "2.12.0-rc.1", "title": "iView", "description": "A high quality UI components Library with Vue.js", "homepage": "http://www.iviewui.com", From 6c2056564ee4d141981f4fd73b5f2adc9e113aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Wed, 4 Apr 2018 15:50:22 +0800 Subject: [PATCH 18/20] release 2.12.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 04905807..f12164fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iview", - "version": "2.12.0-rc.1", + "version": "2.12.0", "title": "iView", "description": "A high quality UI components Library with Vue.js", "homepage": "http://www.iviewui.com", From 309912df0c20e00f510f5b2db0c4da49200368bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Wed, 4 Apr 2018 17:33:13 +0800 Subject: [PATCH 19/20] fixed #3206 --- src/styles/components/table.less | 1 - 1 file changed, 1 deletion(-) diff --git a/src/styles/components/table.less b/src/styles/components/table.less index 41712fcd..5a30ba22 100644 --- a/src/styles/components/table.less +++ b/src/styles/components/table.less @@ -354,7 +354,6 @@ } label { display: block; - margin-bottom: 4px; & > span{ margin-right: 4px; From dee03ef3a19d956490a956dff0f889bc315c948d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 10 Apr 2018 12:16:05 +0800 Subject: [PATCH 20/20] update Poptip demo --- examples/routers/poptip.vue | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/examples/routers/poptip.vue b/examples/routers/poptip.vue index ee64a21e..5f7d2415 100644 --- a/examples/routers/poptip.vue +++ b/examples/routers/poptip.vue @@ -1,21 +1,28 @@