Uncaught DOMException: Failed to read the ‘cssRules’ property from ‘CSSStyleSheet’: Cannot access rules
vue3+vue-router4 在应用过程中,通过 composition api watch
对 router
对象进行监听时,会呈现这个问题。
import {useRoute} from 'vue-router'
const route = useRoute()
watch(
route,
(to, from) => {// do something}
)
解决办法,别监听整个 router
对象,改为监听其某个属性,如监听 path
的变动就能够了。
Uncaught (in promise) DOMException: Failed to read the ‘value’ property from ‘SVGLength’: Could not resolve relative length.
我的项目中用到了 svg,同时做了 svg 依据主题色进行换色解决的性能(监听了路由的变动去解决),打包部署后呈现这个问题,解决办法如第一个。