日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > vue >内容正文

vue

工作169:vue项目报错[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties

發布時間:2023/12/9 vue 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 工作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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。