关于vue3:Vue3问题总结

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


vue3+vue-router4在应用过程中,通过composition api watchrouter对象进行监听时,会呈现这个问题。

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依据主题色进行换色解决的性能(监听了路由的变动去解决),打包部署后呈现这个问题,解决办法如第一个。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理