Merge 28e33fce55
into 33a93a12b4
This commit is contained in:
commit
69b75cdc58
|
@ -7,8 +7,8 @@ import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/re
|
|||
* bottomOffset: 30(default) // The height of the table from the bottom of the page.
|
||||
*/
|
||||
|
||||
const doResize = (el, binding, vnode) => {
|
||||
const { componentInstance: $table } = vnode
|
||||
const doResize = async(el, binding, vnode) => {
|
||||
const { componentInstance: $table } = await vnode
|
||||
|
||||
const { value } = binding
|
||||
|
||||
|
@ -25,17 +25,18 @@ const doResize = (el, binding, vnode) => {
|
|||
}
|
||||
|
||||
export default {
|
||||
bind(el, binding, vnode) {
|
||||
el.resizeListener = () => {
|
||||
doResize(el, binding, vnode)
|
||||
async bind(el, binding, vnode) {
|
||||
el.resizeListener = async() => {
|
||||
await doResize(el, binding, vnode)
|
||||
}
|
||||
// parameter 1 is must be "Element" type
|
||||
addResizeListener(el, el.resizeListener)
|
||||
addResizeListener(window.document.body, el.resizeListener)
|
||||
},
|
||||
inserted(el, binding, vnode) {
|
||||
doResize(el, binding, vnode)
|
||||
async inserted(el, binding, vnode) {
|
||||
await doResize(el, binding, vnode)
|
||||
},
|
||||
unbind(el) {
|
||||
removeResizeListener(window.document.body, el.resizeListener)
|
||||
removeResizeListener(el, el.resizeListener)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue