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
- 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專案重複點選同一標籤路由報錯Vue路由
- [Vue warn]: $attrs is readonly;Webpack externals 配置VueWeb
- VUE專案Vue
- vue init webpack報錯VueWeb
- vue 打包專案時因node記憶體洩露而報錯Vue記憶體洩露
- vue 專案引入字型圖示報錯、不顯示等問題Vue
- Cannot set property ‘type‘ of null(vue)NullVue
- vue專案配置Vue
- vue專案流程Vue
- 建立vue專案Vue
- vue-cli構建vue專案Vue
- 使用vue-cli搭建VUE專案Vue
- VUE:教你如何執行vue專案Vue
- VUE—刪除HelloWorld.vue後報錯 `--fix` option報錯的解決Vue
- Vue-Property-Decorator原始碼分析Vue原始碼
- vue-property-decorator使用指南Vue
- vue-property-decorator基礎教程Vue
- vue專案實踐(vuex + vue-router + vue-resource)Vue
- Vue+Vue-router+Vuex專案實戰Vue
- 【 Vue 】 Vue 使用腳手架建立專案Vue
- vue(16)vue-cli建立專案以及專案結構解析Vue
- Vue部落格專案Vue