Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k views
in Technique[技术] by (71.8m points)

Vue+axios实现渲染数据,有时候有数据,有时候没有数据

image.png

image.png

以上是html代码和js代码

我能确保每一次shopProducts里面都是有数据的,接口这些都没问题,就是渲染数据时不时有问题
image.png

有时候页面上有数据,有时候页面上没有数据,折腾两天了还是搞不定,求大佬救命!!!感激不尽


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

首先,把你的v-if 去掉,换成v-show
然后再多卡看看文档。
或者console.log定位可能存在问题的地方
然后打断点调试,页面是否正常显示


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...