From 74f8ccc87ecb5f8f1720c5ea464216074d38f0c1 Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Sat, 3 Jun 2017 17:01:16 +0800 Subject: [PATCH] Cascader: update popper --- examples/docs/en-US/table.md | 2 +- examples/docs/en-US/tree.md | 2 +- examples/docs/zh-CN/table.md | 2 +- examples/docs/zh-CN/tree.md | 2 +- packages/cascader/src/main.vue | 4 ++++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/docs/en-US/table.md b/examples/docs/en-US/table.md index e56176d6c..2832f7451 100644 --- a/examples/docs/en-US/table.md +++ b/examples/docs/en-US/table.md @@ -1758,7 +1758,7 @@ For table of numbers, you can add an extra row at the table footer displaying ea | fixed | whether column is fixed at left/right. Will be fixed at left if `true` | string/boolean | true/left/right | — | | render-header | render function for table header of this column | Function(h, { column, $index }) | — | — | | sortable | whether column can be sorted | boolean | — | false | -| sort-method | sorting method, works when `sortable` is `true` | Function(a, b) | — | — | +| sort-method | sorting method, works when `sortable` is `true`. Should return a boolean. | Function(a, b) | — | — | | resizable | whether column width can be resized, works when `border` of `el-table` is `true` | boolean | — | false | | formatter | function that formats content | Function(row, column) | — | — | | show-overflow-tooltip | whether to hide extra content and show them in a tooltip when hovering on the cell | boolean | — | false | diff --git a/examples/docs/en-US/tree.md b/examples/docs/en-US/tree.md index 325212fe4..b5cdb9fc1 100644 --- a/examples/docs/en-US/tree.md +++ b/examples/docs/en-US/tree.md @@ -190,7 +190,7 @@ renderContent(h, { node, data, store }) { return ( - + {node.label} diff --git a/examples/docs/zh-CN/table.md b/examples/docs/zh-CN/table.md index c1a8720e1..4ba24e744 100644 --- a/examples/docs/zh-CN/table.md +++ b/examples/docs/zh-CN/table.md @@ -1819,7 +1819,7 @@ | fixed | 列是否固定在左侧或者右侧,true 表示固定在左侧 | string, boolean | true, left, right | — | | render-header | 列标题 Label 区域渲染使用的 Function | Function(h, { column, $index }) | — | — | | sortable | 对应列是否可以排序,如果设置为 'custom',则代表用户希望远程排序,需要监听 Table 的 sort-change 事件 | boolean, string | true, false, 'custom' | false | -| sort-method | 对数据进行排序的时候使用的方法,仅当 sortable 设置为 true 的时候有效 | Function(a, b) | — | — | +| sort-method | 对数据进行排序的时候使用的方法,仅当 sortable 设置为 true 的时候有效,需返回一个布尔值 | Function(a, b) | — | — | | resizable | 对应列是否可以通过拖动改变宽度(需要在 el-table 上设置 border 属性为真) | boolean | — | true | | formatter | 用来格式化内容 | Function(row, column) | — | — | | show-overflow-tooltip | 当内容过长被隐藏时显示 tooltip | Boolean | — | false | diff --git a/examples/docs/zh-CN/tree.md b/examples/docs/zh-CN/tree.md index c34df6034..850d6bd8b 100644 --- a/examples/docs/zh-CN/tree.md +++ b/examples/docs/zh-CN/tree.md @@ -190,7 +190,7 @@ renderContent(h, { node, data, store }) { return ( - + {node.label} diff --git a/packages/cascader/src/main.vue b/packages/cascader/src/main.vue index 458166e32..670944df6 100644 --- a/packages/cascader/src/main.vue +++ b/packages/cascader/src/main.vue @@ -247,6 +247,8 @@ export default { if (close) { this.menuVisible = false; + } else { + this.$nextTick(this.updatePopper); } }, handleInputChange(value) { @@ -255,6 +257,7 @@ export default { if (!value) { this.menu.options = this.options; + this.$nextTick(this.updatePopper); return; } @@ -279,6 +282,7 @@ export default { }]; } this.menu.options = filteredFlatOptions; + this.$nextTick(this.updatePopper); }, renderFilteredOptionLabel(inputValue, optionsStack) { return optionsStack.map((option, index) => {