Browse Source

表格自适应高度指令:支持表格、任意组件自适应高度

master
陈裕财 2 years ago
parent
commit
035b582079
  1. 3
      src/components/mdp-ui/directive/adaptive.js

3
src/components/mdp-ui/directive/adaptive.js

@ -2,7 +2,7 @@
const doResize = async (el, binding, vnode) => { const doResize = async (el, binding, vnode) => {
// 获取表格Dom对象 // 获取表格Dom对象
if(vnode.$table){
if(vnode.componentInstance){
const { const {
componentInstance: $table componentInstance: $table
} = await vnode } = await vnode
@ -50,6 +50,7 @@ export default {
window.addEventListener('resize', el.resizeListener) window.addEventListener('resize', el.resizeListener)
}, },
update(el, binding, vnode) { update(el, binding, vnode) {
debugger;
doResize(el, binding, vnode) doResize(el, binding, vnode)
}, },
// 绑定默认高度 // 绑定默认高度

Loading…
Cancel
Save