第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

帶有 React 路由器的 Golang?

帶有 React 路由器的 Golang?

Go
回首憶惘然 2021-11-08 15:35:43
我如何在 Go 中使用 React Router?例如,我在 Go 中有這個(gè):Echo.Get("/*", *handler which return page with ReactRouter*)這在 React Router 中:React.render((<Router history={History.createHistory()}>    <Route name="index" path="/" component={Main}>        <Route name="users" path="/users" component={Users}>            <Route name="user" path="/user/:userId" component={User} />        </Route>        <Route path="*" component={NotFound} />    </Route></Router>), document.body)但是我一直在獲取索引 (/) 頁面。所有路由的行為都相同('/'、'/users'、'/user/qwe' 等)
查看完整描述

1 回答

?
Helenr

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超4個(gè)贊

您必須使用新綁定呈現(xiàn)不同的路由,或者在處理程序函數(shù)中專門處理該綁定并讀出請求對象的信息。


Echo.Get("/user/:id", getUser)

Echo.Get("/users", listUsers)

Echo.Get("/*", catchAllRemainingCalls)

希望這可以幫助。祝你好運(yùn)!


查看完整回答
反對 回復(fù) 2021-11-08
  • 1 回答
  • 0 關(guān)注
  • 202 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號