gpt4 book ai didi

javascript - 流路由器重定向数据插入 Meteor js

转载 作者:行者123 更新时间:2023-12-03 06:21:31 25 4
gpt4 key购买 nike

我正在使用react、meteor和flow router。数据插入数据库后如何重定向

这是我的功能

Meteor.call('insertQuestion', header, content,      
usernameoremail,date,function(error){
if(error) {
show({text: error.reason, pos: 'bottom-left'});
}
else {
show({text: "Your Question Has been posted", pos: 'top-right'});
}
});

我应该使用哪种流路由器功能?

最佳答案

FlowRouter.go(pathDef, params, queryParams);

这将根据参数通过 FlowRouter.path 获取路径,并重新路由到该路径。

您也可以像这样调用 FlowRouter.go:

FlowRouter.go("/blog");

您可以查看更多关于flow-router here的信息

Meteor.call('insertQuestion', header, content,
usernameoremail,date,function(error){
if(error) {
show({text: error.reason, pos: 'bottom-left'});
}
else {
show({text: "Your Question Has been posted", pos: 'top-right'});
FlowRouter.go(pathDef, params, queryParams)
}
});

关于javascript - 流路由器重定向数据插入 Meteor js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38848650/

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