THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

fix[adaptive.js]: fixed v-el-height-adaptive-table directive bug (#1924)

tags/4.1.0
yuntao1997 花裤衩 10 months ago
parent
commit
c00564617e
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/directive/el-table/adaptive.js

+ 4
- 4
src/directive/el-table/adaptive.js View File

@@ -4,7 +4,7 @@ import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/re
* How to use
* <el-table height="100px" v-el-height-adaptive-table="{bottomOffset: 30}">...</el-table>
* el-table height is must be set
* bottomOffset: 30(default) // The height of the table from the bottom of the page.
* bottomOffset: 30(default) // The height of the table from the bottom of the page.
*/

const doResize = (el, binding, vnode) => {
@@ -29,13 +29,13 @@ export default {
el.resizeListener = () => {
doResize(el, binding, vnode)
}
addResizeListener(el, el.resizeListener)
// parameter 1 is must be "Element" type
addResizeListener(window.document.body, el.resizeListener)
},
inserted(el, binding, vnode) {
doResize(el, binding, vnode)
},
unbind(el) {
removeResizeListener(el, el.resizeListener)
removeResizeListener(window.document.body, el.resizeListener)
}
}

Loading…
Cancel
Save