当前位置:网站首页>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 !!!
边栏推荐
- Angled detection frame | calibrated depth feature for target detection (with implementation source code)
- Digital twin smart factory develops digital twin factory solutions
- Difference between NVIDIA n card and amda card
- Returns the size of the largest binary search subtree in a binary tree
- Why can't the start method be called repeatedly? But the run method can?
- [shutter] open the third-party shutter project
- zhvoice
- 【ML】李宏毅三:梯度下降&分类(高斯分布)
- Data set - fault diagnosis: various data and data description of bearings of Western Reserve University
- Digital collection trading website domestic digital collection trading platform
猜你喜欢

Improvement of RTP receiving and sending PS stream tool (II)

Flexible combination of applications is a false proposition that has existed for 40 years

Why can't the start method be called repeatedly? But the run method can?
![MATLAB signal processing [Q & a notes-1]](/img/53/ae081820fe81ce28e1f04914678a6f.png)
MATLAB signal processing [Q & a notes-1]

Happy Lantern Festival, how many of these technical lantern riddles can you guess correctly?

请求与响应

秒杀系统设计

来自数砖大佬的 130页 PPT 深入介绍 Apache Spark 3.2 & 3.3 新功能

Master the development of facial expression recognition based on deep learning (based on paddlepaddle)

Load balancing cluster (LBC)
随机推荐
JDBC tutorial
sourcetree 详细
A single element in an ordered array -- Valentine's Day mental problems
程序分析与优化 - 9 附录 XLA的缓冲区指派
How to apply for company email when registering in company email format?
How to set automatic reply for mailbox and enterprise mailbox?
Convolution和Batch normalization的融合
Interface difference test - diffy tool
AcWing_188. 武士风度的牛_bfs
How to specify const array in the global scope of rust- How to specify const array in global scope in Rust?
RTP 接发ps流工具改进(二)
Talk with the interviewer about the pit of MySQL sorting (including: duplicate data problem in order by limit page)
67 page overall planning and construction plan for a new smart city (download attached)
接口自动化覆盖率统计——Jacoco使用
Returns the size of the largest binary search subtree in a binary tree
Leetcode skimming - game 280
Pytorch里面多任务Loss是加起来还是分别backward?
监控容器运行时工具Falco
Open Source | Wenxin Big Model Ernie Tiny Lightweight Technology, Accurate and Fast, full Open Effect
Explain in detail the process of realizing Chinese text classification by CNN