Vue3问题总结

Uncaught DOMException: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules


vue3+vue-router4在使用过程当中,经过composition api watchrouter对象进行监听时,会出现这个问题。css

import { useRoute } from 'vue-router'
const route = useRoute()
watch(
      route,
      (to, from) => {
        // do something
      }
    )

解决办法,别监听整个router对象,改成监听其某个属性,如监听path的变化就能够了。vue

Uncaught (in promise) DOMException: Failed to read the 'value' property from 'SVGLength': Could not resolve relative length.


项目中用到了svg,同时作了svg根据主题色进行换色处理的功能(监听了路由的变化去处理),打包部署后出现这个问题,解决办法如第一个。vue-router

相关文章
相关标签/搜索