Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

at-table 组件渲染完成后当容器发生变化会报出警告错误 #149

Open
stepday opened this issue Mar 8, 2019 · 2 comments
Open

Comments

@stepday
Copy link

stepday commented Mar 8, 2019

  • 错误如下所示:
vendor.4d1605.js:6 [Vue warn]: Error in nextTick: "TypeError: Cannot read property 'querySelectorAll' of undefined"

found in

---> <AtTable>
       <DemoBox>
         <Anonymous>
           <Anonymous>
             <Root>
@turboxp53
Copy link

turboxp53 commented Apr 22, 2019

两种方式:
1)handleResize()中的逻辑全部注释掉 !!强烈推荐这种,移除监听window对象resize事件效果更好
2)修改源码
const $td = this.$refs.body && this.$refs.body.querySelectorAll('tr')[0].querySelectorAll('td')
if($td){
// code
}

@turboxp53
Copy link

原来是源码中的销毁注册事件的名称写错了
beforeDestory =》beforeDestroy
不过还是建议移除监听window对象resize事件效果更好,你们尝试下就晓得了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants