国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

vue Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘comcode‘)

這篇具有很好參考價值的文章主要介紹了vue Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘comcode‘)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

?在查看信息時,界面沒反應,然后查看控制臺報錯

index.vue?t=1680763420735:497 Uncaught (in promise) TypeError: 
Cannot read properties of undefined (reading 'comcode')

vue Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘comcode‘),前端,#  VUE,vue.js,javascript,前端

然后查找獲取數(shù)據(jù)的方法

  getInfo(row.id).then((response) => {
    info.value = response.data ;
  });

?f12查看返回數(shù)據(jù)信息如下:

{msg: "操作成功", code: 200}

因為沒有正確返回數(shù)據(jù),導致獲取response.data時是一個undefined ,因此展示數(shù)據(jù)的時候就會出錯

{{ info.comcode}}

所以修改獲取數(shù)據(jù)的function,然后將獲取的數(shù)據(jù)判斷一下,如果為undefined,則賦值一個新對象,否則從data中獲取數(shù)據(jù)文章來源地址http://www.zghlxwxcb.cn/news/detail-621328.html

  getInfo(row.id).then((response) => {
		info.value = response.data === undefined ? {} : response.data;
	});

到了這里,關于vue Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘comcode‘)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • Uncaught TypeError: Cannot read properties of undefined (reading ‘remove‘)

    在Vue 3中,你可能會遇到“Uncaught TypeError: Cannot read properties of undefined (reading \\\'remove\\\')”這樣的錯誤,這通常是因為在組件銷毀時,嘗試訪問已經(jīng)被銷毀的元素或事件監(jiān)聽器。 為了解決這個問題,你可以在組件銷毀之前,確保移除所有的事件監(jiān)聽器和其他可能導致問題的操作。

    2024年01月20日
    瀏覽(42)
  • Uncaught TypeError: Cannot read properties of null (reading ‘getAttribute‘)

    Uncaught TypeError: Cannot read properties of null (reading ‘getAttribute‘)

    簡述:vue項目報錯, Uncaught TypeError: Cannot read properties of null (reading \\\'getAttribute\\\') , 翻譯:無法讀取null屬性(讀取\\\'getAttribute\\\'), 解析:getAttribute()是js獲取屬性方法,就是getAttribute不能讀取null的屬性, 這種錯誤一般出現(xiàn)在使用Echarts和地圖后,當切換到空白頁面后,重置頁面時,

    2024年02月11日
    瀏覽(43)
  • Uncaught TypeError: Cannot read properties of undefined (reading ‘use‘)

    報錯:Uncaught TypeError: Cannot read properties of undefined (reading ‘use’) 原因:Vue-router版本問題,在vue-router3可在router/index.js中安裝router插件,但4不支持 解決: 1、在router/index.js中,導出{createRouter, createWebHistory}兩個函數(shù) 使用createRouter來創(chuàng)建路由對象 使用createWebHistory函數(shù)賦值給histor

    2024年02月13日
    瀏覽(43)
  • Uncaught TypeError: Cannot read properties of null (reading ‘style‘)

    Uncaught TypeError: Cannot read properties of null (reading ‘style‘)

    Uncaught TypeError: Cannot read properties of null (reading \\\'style\\\') 2:報錯的原因 文檔的加載過程是自上向下加載。使用未命名的變量、會報錯 3;解決辦法 1、將Javascript代碼從標簽中放入body中 2、 window.onload = function(){}框起來

    2024年02月15日
    瀏覽(51)
  • easyui Uncaught TypeError: Cannot read properties of null (reading ‘width‘)

    easyui Uncaught TypeError: Cannot read properties of null (reading ‘width‘)

    問題描述 在將easyui1.3.6版本替換為1.7版本的時候。只有表頭顯示出來了,內(nèi)容并沒有顯示出來,且報異常。表頭也沒有按照期望的寬度正常顯示。錯誤提示如下 問題原因及解決辦法 該問題出現(xiàn)的原因是因為該表格的表頭涉及到跨行跨列問題,原因是最后一欄出貨記錄的跨列

    2024年02月16日
    瀏覽(26)
  • 【Error】Uncaught TypeError: Cannot read properties of undefined (reading ‘get’)

    【Error】Uncaught TypeError: Cannot read properties of undefined (reading ‘get’)

    報錯原因: 返回值為undefined 解決: vue3可用?

    2024年04月08日
    瀏覽(44)
  • 錯誤解決:Uncaught TypeError: Cannot read properties of null (reading ‘XXX‘).

    錯誤解決:Uncaught TypeError: Cannot read properties of null (reading ‘XXX‘).

    報錯信息: 前端代碼: ? ? ? ?這里的目的是打開特定頁面后,自動將用戶登錄后 session 中保存的 username 取出并將值賦給input標簽。 ? ? ? ?但是在測試的時候,打開該頁面控制臺就出現(xiàn)報錯。報錯意思大概就是你需要的這個 “username” 屬性的值本來就是空的,所以無法獲

    2024年02月12日
    瀏覽(28)
  • Uncaught TypeError: Cannot read properties of null (reading ‘name‘) 和NoSuchMethodException

    Uncaught TypeError: Cannot read properties of null (reading ‘name‘) 和NoSuchMethodException

    分析:這是由于還沒登錄,data.name 還沒獲取到值,所以為null 方法1:可以不管,它不會影響其他功能,當你登錄后,便不會報這個錯 方法2:給它一個if判斷是否為null 修改前: 修改后: 修改完后記得先清楚瀏覽器緩存(或換個瀏覽器)再測試。成功解決! 還有一個問題是缺

    2024年02月12日
    瀏覽(19)
  • 【Vue】- 報錯 Error in render: “TypeError: Cannot read properties of undefined (reading ‘nickname‘)“

    【Vue】- 報錯 Error in render: “TypeError: Cannot read properties of undefined (reading ‘nickname‘)“

    在created()鉤子函數(shù)請求接口并報錯數(shù)據(jù),渲染在dom元素是可以正常渲染,但是在開發(fā)者工具中就會報錯 Error in render: \\\"TypeError: Cannot read properties of undefined (reading \\\'nickname\\\')\\\" ?意思是 在created調(diào)用封裝請求接口的函數(shù) ,獲取到的數(shù)據(jù)再給保存起來并渲染到dom元素,不過數(shù)據(jù)渲染之

    2023年04月21日
    瀏覽(36)
  • [Vue warn]: Error in nextTick: “TypeError: Cannot read properties of undefined (reading ‘toggleRowSe

    [Vue warn]: Error in nextTick: “TypeError: Cannot read properties of undefined (reading ‘toggleRowSe

    [Vue warn]: Error in nextTick: \\\"TypeError: Cannot read properties of undefined (reading \\\'toggleRowSelection\\\')\\\" 因為引用未加載完,所以報未定義的錯誤,異步函數(shù)等待加載完成,并且得到數(shù)值后再執(zhí)行,報錯就沒了。 ?

    2024年02月12日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包