報錯: Method "watch" has type "object" in the component definition. Did you reference the function Method "watch" has type "object" in the component definition. Did you reference the function correctly?vue
緣由: watch 是一個對象,應該以鍵值對的形式來使用,可是我 將 watch 放到了 methods: {} 中,致使了這個問題;函數
解決辦法: 將watch 對象 拿出來,與 methods 平級;this
附上當時的代碼:spa