微信小程序云开发cnt/w与各项构建查询条件
发布时间
阅读量:
阅读量
记录 2020-07-27
count 代表记录个数
前端页面中事件与按钮编号 btnNum 进行了绑定
wxml
<button type="primary" bindtap="btnNum">获取记录个数</button>
js
//获取记录个数
btnNum(){
db.collection("demolist").count()
.then(res=>{
console.log(res);
})
},
watch 监听与重复渲染机制
需要设置两个参数
onChange:res=>{} 作为回调函数
onError:res=>{} 作为回调函数
达成对数据的实时监听效果
功能:能够实现页面的重复刷新与重新渲染
/** * 生命周期函数--监听页面加载
*/
onLoad: function (options) {
db.collection("d
全部评论 (0)
还没有任何评论哟~
