是否可以同时拥有/ posts和/ posts /:id?

时间:2019-09-29 00:50:03

标签: reactjs react-router react-router-dom

我正在使用react-router,我想知道怎么可能同时拥有两个路由:x.com/posts和x.com/posts/3

在/ posts路径中,我想显示所有帖子列表,在/ posts / 3中,我想显示帖子的详细信息

1 个答案:

答案 0 :(得分:1)

是的!有可能的。请从react router docs查看以下说明:

var timer = args[1]
var channels = msg.channel

channels.overwritePermissions(msg.mentions.users.first(), { SEND_MESSAGES: false });

msg.reply(`Muted ${msg.mentions.users.first().username} for ${timer} seconds`)

setTimeout(unmute, timer * 1000);

function unmute(){
  channels.overwritePermissions(msg.mentions.users.first(), { SEND_MESSAGES: true });
}