Skip to content

1.2.0

Compare
Choose a tag to compare
@hefangshi hefangshi released this 18 Jul 10:56
· 120 commits to master since this release
  • 支持 res.bigpipe.bindPageOnly 模式,仅在页面渲染时抓取数据源,简化 quickling 开发的判断
module.exports = async function (req, res) {
    // 无论是页面请求还是Quickling请求均会执行getCommonData
    let data = await getCommonData();
    // 只在widgetA渲染时执行
    res.bigpipe.bind('widgetA', async function () {
        let data = await getWidgetA();
        return data;
    });
    // 只在页面渲染时执行,Quickling请求时不执行
    res.bigpipe.bindPageOnly(async function () {
        let data = await getPageOnlyData();
        return data;
    });
    res.render('spa/page/index.tpl', data);
};