小程序云开发查询显示不正常
发布于 6 年前 作者 hfang 2620 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

一会在编辑,每次贴代码总是失败,稍等

function getNoticeList(t, k) {
  //查询的类 绑定对应的表
  noticeList.where({
    isShow: true, //查询条件 用户公开的内容
  })
    .limit(10) // 限制返回数量为 10 条
    .get()
    .then(res => {
      console.log('查询 noticeList 成功,返回的数据是', res);
      that.setData({
        notice_List: res.data
      });
    })
    .catch(err => {
      console.error('查询yanList失败,错误原因是:', err);
      that.setData({
        notice_List: []
      });
    });
}
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo
1 回复

发帖不能写多段代码么?为什么编辑好了提交总是失败?

我的代码如下所示

 
function getPublicYanList(t, k) {
  //查询的类 绑定对应的表
  yanList.where({
      isPublic: false, //查询条件 用户公开的内容
    })
    .limit(20) // 限制返回数量为 10 条
    .get()
    .then(res => {
      console.log('查询yanList成功,返回的数据是', res);
      that.setData({
        yan_List: res.data
      });
    })
    .catch(err => {
      console.error('查询yanList失败,错误原因是:', err);
      that.setData({
        yan_List: []
      });
    });
}
 

实际上是有数据的

回到顶部