Computed property was assigned to but it has no setter.
今天有一個很奇怪的bug,報錯的原因我們可以看的很清楚,計算屬性沒有設定setter
這是計算屬性原始碼,計算屬性有getter和setter,預設只有getter,需要時可以設定setter
computed:{
isActive(){
return this.$route.path.indexOf(this.path) !== -1
}
},
雖然效果仍然可以實現,但是就是每次用該資料都會報錯,看了vue官方文件
官方演示也是不帶setter的,為啥我不設定setter就要報錯呢?
最後修改方案:
computed: {
isActive:{
get(){
return this.$route.path.indexOf(this.path) !== -1
},
set(val){}
}
},
相關推薦
Computed property was assigned to but it has no setter.
技術標籤:# vue問題vue 今天有一個很奇怪的bug,報錯的原因我們可以看的很清楚,計算屬性沒有設定setter這是計算屬性原始碼,計算屬性有getter和setter,預設只有getter,需要時可以設定setter
bug:Vuex - Computed property “name” was assigned to but it has no setter
問題 v-model取值問題 Vuex - Computed property “xxx” was assigned to but it has no setter 報錯情形
Vue——解決報錯 Computed property "****" was assigned to but it has no setter.
在最近的專案中遇到了如下的警告資訊: [Vue warn]:Computed property \" currentStep\" was assigned to but it has no setter.(意思是:計算屬性 currentStep被賦值了,但此它並未定義 set方法 。)
Vue報錯:Computed property “XX“ was assigned to but it has no setter.解決方法
技術標籤:vuevuejs Vue報錯:Computed property “XX” was assigned to but it has no setter. 【程式碼背景】
The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak
SSM整合小專案關閉時tomcat報錯: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it.This is very likely to create a memory
Redis An unhandled exception has occurred while executing the request. MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.
錯誤資訊: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware|ERROR|An unhandled exception has occurred while executing the request. MISCONF Redis is configured to save RDB snapshots,
Redis報錯:MISCONF Redis is configured to save RDB snapshots, but it is currently not able to...
Outline 今天在啟動celery時報錯: [2020-12-21 14:12:48,615: ERROR/MainProcess] consumer: Cannot connect to redis://127.0.0.1:6379/1: MISCONF Redis is│configured to save RDB snapshots, but it is curre
Redis錯誤(MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist )
技術標籤:redisredis 做redisSADD myset “hello” 事遇到一個錯誤 (error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify
Nuxt報錯:Though the "loose" option was set to "false" in your @babel/preset-env config, it will not的問題解決
一、問題情況 nuxt 執行報錯 : WARN Though the \"loose\" option was set to \"false\" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the \"loos
Asp.net問題隨筆: An attempt was made to use the context while it is…nce members are not guaranteed to be thread safe
用.net 5在做Vue的webapi開發的時候,一個頁面調多個介面的時候就會返回這樣的紅色報錯:An attempt was made to use the context while it is…nce members are not guaranteed to be thread safe。
sass-loader安裝+Failed to resolve loader: sass-loader You may need to install it.解決方法
方式一: 通過cnpm安裝node-sass cnpm install node-sass --save 方式二: 通過npm 安裝 1、安裝sass-loader
The application was unable to start correctly (0xc000007b)的勉強解決方案
在我的電腦上,Unity 3D和有道詞典的安裝包(UnitySetup64.exe和YoudaoDictSetup.exe),啟動時報錯“The application was unable to start correctly (0xc000007b). Click OK to close the application.”而
解決:java.lang.IllegalStateException: Annotation @EnableCircuitBreaker found, but there are no implementations. Did you forget to include a starter?
在主類新增@EnableCircuitBreaker或@SpringCloudApplication註解 pom.xml裡新增 <dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-hystrix</
ajax跨域請求問題:Access to XMLHttpRequest at……has been blocked by CORS policy: Cross origin requests
技術標籤:工作筆記Node.jsjquerynode.jsjavascript 背景:原生代碼除錯時,載入本地資源正常,jquery的AJAX請求服務端資源報錯。
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set
CMake Error: CMake was unable to find a build program corresponding to \"Ninja\".CMAKE_MAKE_PROGRAM is not set
An attempt was made to call a method that does not exist. The attempt was made from the following location:
1,SpringBoot專案啟動報錯 *************************** APPLICATION FAILED TO START ***************************
org.apache.coyote.http11.HeadersTooLargeException: An attempt was made to write more data to the response headers than there was room available in the buffer. Increase maxHttpHeaderSize
springcloud專案,請求某個服務時報錯如下:org.apache.coyote.http11.HeadersTooLargeException: An attempt was made to write more data to the response headers than there was room available in the buffer.
新增MySq出現The ‘InnoDB‘ feature is disabled; you need MySQL built with ‘InnoDB‘ to have it working
在使用navicat建立資料庫的時候,報錯提示:The ‘InnoDB’ feature is disabled; you need MySQL built with ‘InnoDB’ to have it working,自己取巧解決了這個問題,來這裡分享一下。
System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.
PS E:\\C#\\core\\mvc\\mvctest> dotnet run正在生成...crit: Microsoft.AspNetCore.Server.Kestrel[0]Unable to start Kestrel.System.InvalidOperationException: Unable to configure HTTPS endpoint. No ser
解決pyautogui.PyAutoGUIException: PyAutoGUI was unable to import pyscreeze.報錯
1.“PyAutoGUI was unable to import pyscreeze. (This is likely because you’re running a version of Python that Pillow (which pyscreeze depends on) doesn’t support currently.) Please install this mod