琦琦宝贝
琦琦宝贝
  • 发布:2019-11-14 15:43
  • 更新:2021-02-28 23:07
  • 阅读:3283

切换页面的时候 有的数据没有请求完成 页面变量都显示undefined,怎么实现hello uniapp里面的加载中

分类:uni-app

切换页面的时候 有的数据没有请求完成 页面变量都显示undefined,怎么实现hello uniapp里面的加载中

2019-11-14 15:43 负责人:无 分享
已邀请:
k***@163.com

k***@163.com - kk

请问你这个问题解决了吗 我也有这个问题

cissy798

cissy798

1、data里有给变量默认值吗?
2、uni.showLoading

3***@qq.com

3***@qq.com

请问楼主解决了吗?我也遇到了这个问题。

浅言陌语

浅言陌语

<div v-if="showCard"><div> // 需要加载显示的数据

data() {
return {
showCard:false, // 让未加载完的数据不显示
}
}

onLoad() {
this.$vux.loading.show({ text: "正在加载" });
this.$api.cardInterface
.getCard({
// cardId:"001"
})
.then(res => {
this.$vux.loading.hide();
console.log(res);
if (res.data.success) {
this.showCard = true; // 让加载完的数据显示
this.card = res.data;
}
})
.catch(err => {
this.$vux.loading.hide();
});

小少年报

小少年报

vue不是有[v-cloak]{display: none;] 吗

4***@qq.com

4***@qq.com

uniapp中dadak中的变量,有时还是undefind,我地天,我真的不能再受打击了

该问题目前已经被锁定, 无法添加新回复