render: function (callback) { const data = dataManager.getData('data'); if (data) { const html = template.compile(tpl)({list: data}); callback(null, html); } else { // 模拟异步加载数据 $.weui.loading('加载中...'); setTimeout(() => { dataManager.setData('data', remote); const html = template.compile(tpl)({list: remote}); callback(null, html); $.weui.hideLoading(); }, 800); } },
setTimeout(() => { dataManager.setData('data', remote); const html = template.compile(tpl)({list: remote}); callback(null, html); $.weui.hideLoading(); }, 800);