当前位置:网站首页>TypeError: Cannot read properties of undefined (reading ***)
TypeError: Cannot read properties of undefined (reading ***)
2022-07-03 00:11:00 【Z_ Xshan】
I read several versions elsewhere
Version of a
1. Check your data Does the defined attribute not have the attribute you use , If not, define a , as follows :
#template
<div class="he-info__item">
<span class="he-label"> Name of consignee :</span>
<span class="he-value">{
{ detail.buyer.name }}</span>
</div>
<div class="he-info__item">
<span class="he-label"> Contact information :</span>
<span class="he-value">{
{ detail.buyer.mobile }}</span>
</div>
#js
export default {
data () {
detail: {
buyer: {
name: "",
mobile: "",
},
user: {
nickname: "",
},
},
}
}
Version 2
//2. It may also be that the data returned to you by the backend does not have this attribute perhaps Some of the returned data There are plenty of them null ,
// You can't write at this time {
{ item.xxx || “” }} Otherwise, it will report a mistake Cannot read properties of undefined (reading ‘xxx‘)“ It can be solved like this as follows :
#template
<div v-if="!!item.invite">{
{ item.invite.nickname }}</div> // Only when this attribute is present
// Or so it goes
<div v-if="item?.invite">{
{ item.invite.nickname }}</div> // Only when this attribute is present
<div v-else>{
{ "" }}</div> // No return perhaps null Directly fill in “”Version 3
//3. There is another kind on the Internet View not updated Data has not been returned You start using this property You can add
this.$nectTick (()=>{// get data }) Wrap it If there is no code error in my solution, you can download it again and try it
hold node_modules Delete and
npm i
or
cnpm iIf the download package is wrong when starting the project Then this method is a little cuddly
We can try src Next .umi Delete the file

Then download the dependency package that reports an error
Then start the project !!!
边栏推荐
- MySQL advanced learning notes (4)
- 67页新型智慧城市整体规划建设方案(附下载)
- Architecture: database architecture design
- ArrayList analysis 2: pits in ITR, listiterator, and sublist
- Data set - fault diagnosis: various data and data description of bearings of Western Reserve University
- 请问大家在什么网站上能查到英文文献?
- Judge whether the binary tree is full binary tree
- 開源了 | 文心大模型ERNIE-Tiny輕量化技術,又准又快,效果全開
- Interpretation of new plug-ins | how to enhance authentication capability with forward auth
- 接口差异测试——Diffy工具
猜你喜欢

Digital twin smart factory develops digital twin factory solutions

Detailed explanation of 'viewpager' in compose | developer said · dtalk

JDBC練習案例

35 pages dangerous chemicals safety management platform solution 2022 Edition

Difference between NVIDIA n card and amda card

JDBC教程

JDBC tutorial

95 pages of smart education solutions 2022

2022 latest and complete interview questions for software testing

Additional: token; (don't read until you finish writing...)
随机推荐
Flexible combination of applications is a false proposition that has existed for 40 years
容器运行时分析
返回二叉树中最大的二叉搜索子树的大小
【OJ】两个数组的交集(set、哈希映射 ...)
Architecture: database architecture design
95页智慧教育解决方案2022
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)
SQL query statement parameters are written successfully
Master the development of facial expression recognition based on deep learning (based on paddlepaddle)
Top Devops tool chain inventory
附加:token;(没写完,别看…)
JDBC练习案例
Using tensorflow to realize voiceprint recognition
Explain in detail the process of realizing Chinese text classification by CNN
95 pages of smart education solutions 2022
论文的英文文献在哪找(除了知网)?
How to specify const array in the global scope of rust- How to specify const array in global scope in Rust?
Linux 下安装 redis
Returns the size of the largest binary search subtree in a binary tree
接口差异测试——Diffy工具