Vue3中对象遇到不存在的属性时不会报错无法直接知道代码异常怎么处理 #12501
Unanswered
workCleaner
asked this question in
Help/Questions
Replies: 1 comment 2 replies
-
利用 try{...} catch(e) {...} 去包裹下解决 或者 a && a.b |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Vue3中对象遇到不存在的属性时:
a.b 当a = null时 b肯定是不存在的
但是现在vue3不进行报错 只是代码停止运行后续代码
有好的办法吗
Beta Was this translation helpful? Give feedback.
All reactions