vue專案報錯[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties start
vue專案中報錯:
[Vue warn]: Property "visible" must be accessed with "$data.visible" because properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internalsSee: https://vuejs.org/v2/api/#data
如下:
報錯原因:
專案中使用的是Element UI訊息提示Message:import { Message } from 'element-ui';
請求響應攔截器中err處理的程式碼錯誤:
Message.error(response.data.data|| "出現錯誤,請稍後再試");//寫法錯誤,
因為Message.error()或Message()接收型別string/VNode,而現在response.data.data是個陣列,所以報錯。
解決方法:
改成如下兩種寫法都可以了
Message.error({
message: response.data.data || "出現錯誤,請稍後再試"
})
或
Message({
type:'error',
message: response.data.data || "出現錯誤,請稍後再試"
})
總結:這種錯誤一般都是因為傳的引數跟方法接受引數型別不符引起的。
相關文章
- Property "visible" must be accessed with "$data.visible" because properties
- Property "visible" must be accessed with "$data.visible"
- Property visible must be accessed with $ or _ are not proxied in the Vue instance to prevent錯誤Vue
- 怎樣解決 [Vue warn]: The computed property "count" is already defined in data. 報錯問題?Vue
- [Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined" found in <App> at src/App.vueVueErrorUndefinedAPP
- [Vue warn]: Attribute "id" is ignored on component because the component is a fragment instanVueFragment
- vue+echarts報錯Cannot read property ‘init‘ of underfinedVueEcharts
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- Vue專案除錯技能Vue除錯
- [Vue warn]: The data property "dialogVisible" is already declared as a prop. Use prop default valueVue
- Vue 啟動專案報錯 Failed to compile with 2 errorsVueAICompileError
- 用vite建立vue3專案報錯解決ViteVue
- vue-property-decoratorVue
- 執行專案報錯Cannot read property 'styles' of undefinedUndefined
- vue專案引用font-awesome字型打包路徑報錯Vue
- 關於vue、es6專案在IE中報錯Vue
- 工作193:vue.runtime.esm.js?2b0e:619 [Vue warn]: <transition-group> children must be keyed: <ElTag>VueJS
- [Vue warn]: $attrs is readonly;Webpack externals 配置VueWeb
- vue專案重複點選同一標籤路由報錯Vue路由
- vue2專案 一直報ts-plugin錯誤VuePlugin
- VUE專案Vue
- 建立Vue3+Ts專案的main.ts中App.vue報錯解決方案VueAIAPP
- [vue]執行vue --version報錯:-4054 ENOSYSVue
- vue init webpack報錯VueWeb
- 安裝VUE報錯Vue
- [VUE]vue3新建專案Vue
- vue 打包專案時因node記憶體洩露而報錯Vue記憶體洩露
- vue 專案引入字型圖示報錯、不顯示等問題Vue
- Cannot set property ‘type‘ of null(vue)NullVue
- Nginx部署Vue前端專案,部署多個Vue專案NginxVue前端
- vue使用vue-amap元件報錯AMap is not definedVue元件
- vue專案配置Vue
- vue專案流程Vue
- 建立vue專案Vue
- vue2匯入專案遇到錯誤Vue
- vue-cli構建vue專案Vue
- 使用vue-cli搭建VUE專案Vue
- VUE:教你如何執行vue專案Vue