From c00564617e8c58868d96a645f527864a3a5cc6aa Mon Sep 17 00:00:00 2001 From: yuntao1997 <510835147@qq.com> Date: Tue, 16 Apr 2019 14:56:07 +0800 Subject: [PATCH] fix[adaptive.js]: fixed v-el-height-adaptive-table directive bug (#1924) --- src/directive/el-table/adaptive.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/directive/el-table/adaptive.js b/src/directive/el-table/adaptive.js index 8beacff1..d229e9fd 100644 --- a/src/directive/el-table/adaptive.js +++ b/src/directive/el-table/adaptive.js @@ -4,7 +4,7 @@ import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/re * How to use * ... * 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) } }