工作169:vue项目报错[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties
生活随笔
收集整理的這篇文章主要介紹了
工作169:vue项目报错[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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 || "出現錯誤,請稍后再試"})總結:這種錯誤一般都是因為傳的參數跟方法接受參數類型不符引起的。
總結
以上是生活随笔為你收集整理的工作169:vue项目报错[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: multisim中pwl_Multisi
- 下一篇: App 版本更新 versionUpda