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

[BorderBox*]:报错Cannot read properties of null (reading '$el') #43

Open
comWang opened this issue Aug 2, 2023 · 4 comments
Open

Comments

@comWang
Copy link

comWang commented Aug 2, 2023

1.使用了BorderBox组件的页面,卸载时必会出现Cannot read properties of null (reading '$el')错误;
2. 因此,在使用v-if销毁页面或者keepalive移除缓存页面时,都会出现此问题;
3. 定位到原因可能是getRefDom方法未对入参ref进行非空判断,因为在上面的1、2情况下,ref的值会是null;
4. 如果是单独的大屏,没有离开页面的情形,自然不会出现上述情形;
5. 希望作者能够看到,感谢作者的付出!

@ghost
Copy link

ghost commented Aug 10, 2023

如果是用路由跳转到其他页面因为报错跳转不了的 可以在组件销毁前if设置为false 没找到其他方法

@Ivanzyh
Copy link

Ivanzyh commented Sep 8, 2023

如果是用路由跳转到其他页面因为报错跳转不了的 可以在组件销毁前if设置为false 没找到其他方法

想请教一下具体是怎么做的呢

@Txq930530
Copy link

给这个组件外层包裹一个div,在执行路由导航之前设置div v-if="false"

@HiSun001
Copy link

实在没办法了,在源码中加了个判断,用到哪个改哪个吧。坐等作者修复
微信截图_20240731170226

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

4 participants