gpt4 book ai didi

javascript - SailsJS : how to access the res. 从任何地方渲染功能

转载 作者:搜寻专家 更新时间:2023-11-01 00:18:33 24 4
gpt4 key购买 nike

我只需要在某些地方使用 res.render 函数,但它不会传递给我正在使用的回调。某处是否有渲染函数的全局版本,或者是否有其他访问方法?

最佳答案

在 Sails v0.10.4 中有

sails.renderView(viewPath, options, callback);

此外,在呈现电子邮件时,您可能不需要使用布局。所以在调用sails.renderView之前,添加

options.layout = false;

关于javascript - SailsJS : how to access the res. 从任何地方渲染功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21357771/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com