浏览代码

Cascader: update popper

Leopoldthecoder 8 年之前
父节点
当前提交
74f8ccc87e

+ 1 - 1
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 |

+ 1 - 1
examples/docs/en-US/tree.md

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

+ 1 - 1
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 |

+ 1 - 1
examples/docs/zh-CN/tree.md

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

+ 4 - 0
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) => {