项目使用vue3+Naive UI,一开始开发到一半没用keep-alive这个组件,后来加进去之后只要切换路由就出现报错情况,如图:
代码:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'value')
at invokeDirectiveHook (runtime-core.esm-bundler.js:2812:47)
at Array.<anonymous> (runtime-core.esm-bundler.js:5380:25)
at flushPostFlushCbs (runtime-core.esm-bundler.js:343:46)
at flushJobs (runtime-core.esm-bundler.js:397:9)
卡了很久,经过不断的查找终于找到了问题,如下
没错就是这个组件中加了style属性的原因,去掉之后就正常了