Cascader: update popper

pull/3526/merge
Leopoldthecoder 2017-06-03 17:01:16 +08:00 committed by 杨奕
parent bffb1808dc
commit 74f8ccc87e
5 changed files with 8 additions and 4 deletions

View File

@ -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 | — | | 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 }) | — | — | | render-header | render function for table header of this column | Function(h, { column, $index }) | — | — |
| sortable | whether column can be sorted | boolean | — | false | | 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 | | 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) | — | — | | 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 | | show-overflow-tooltip | whether to hide extra content and show them in a tooltip when hovering on the cell | boolean | — | false |

View File

@ -190,7 +190,7 @@
renderContent(h, { node, data, store }) { renderContent(h, { node, data, store }) {
return ( return (
<span> <span style="white-space: normal">
<span> <span>
<span>{node.label}</span> <span>{node.label}</span>
</span> </span>

View File

@ -1819,7 +1819,7 @@
| fixed | 列是否固定在左侧或者右侧true 表示固定在左侧 | string, boolean | true, left, right | — | | fixed | 列是否固定在左侧或者右侧true 表示固定在左侧 | string, boolean | true, left, right | — |
| render-header | 列标题 Label 区域渲染使用的 Function | Function(h, { column, $index }) | — | — | | render-header | 列标题 Label 区域渲染使用的 Function | Function(h, { column, $index }) | — | — |
| sortable | 对应列是否可以排序,如果设置为 'custom',则代表用户希望远程排序,需要监听 Table 的 sort-change 事件 | boolean, string | true, false, 'custom' | false | | 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 | | resizable | 对应列是否可以通过拖动改变宽度(需要在 el-table 上设置 border 属性为真) | boolean | — | true |
| formatter | 用来格式化内容 | Function(row, column) | — | — | | formatter | 用来格式化内容 | Function(row, column) | — | — |
| show-overflow-tooltip | 当内容过长被隐藏时显示 tooltip | Boolean | — | false | | show-overflow-tooltip | 当内容过长被隐藏时显示 tooltip | Boolean | — | false |

View File

@ -190,7 +190,7 @@
renderContent(h, { node, data, store }) { renderContent(h, { node, data, store }) {
return ( return (
<span> <span style="white-space: normal">
<span> <span>
<span>{node.label}</span> <span>{node.label}</span>
</span> </span>

View File

@ -247,6 +247,8 @@ export default {
if (close) { if (close) {
this.menuVisible = false; this.menuVisible = false;
} else {
this.$nextTick(this.updatePopper);
} }
}, },
handleInputChange(value) { handleInputChange(value) {
@ -255,6 +257,7 @@ export default {
if (!value) { if (!value) {
this.menu.options = this.options; this.menu.options = this.options;
this.$nextTick(this.updatePopper);
return; return;
} }
@ -279,6 +282,7 @@ export default {
}]; }];
} }
this.menu.options = filteredFlatOptions; this.menu.options = filteredFlatOptions;
this.$nextTick(this.updatePopper);
}, },
renderFilteredOptionLabel(inputValue, optionsStack) { renderFilteredOptionLabel(inputValue, optionsStack) {
return optionsStack.map((option, index) => { return optionsStack.map((option, index) => {