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

相關文章
相關標籤/搜索