亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

react 配置的路由·不管用

react 配置的路由·不管用

婷婷同學_ 2018-11-22 14:14:28
路由配置如下:用webpack-dev-server啟動項目,輸入http://localhost:8080/#和http://localhost:8080/都顯示index,輸入http://localhost:8080/list提示Cannot GET /list,http://localhost:8080/#/list也顯示index 就是不會顯示list 求解??????
查看完整描述

1 回答

?
心有法竹

TA貢獻1866條經驗 獲得超5個贊

history改browserHistory

render(){

    return (

        <Router history={browserHistory}>

            <Route component={Index} path="/" />

            <Route component={ComponentList} path="/list" />

        </Router>

    );

}

然后看看你的ComponentList 這個寫的是否正確

import React from 'react'

export default class ComponentList extends React.Component {

    render() {

        return(

           // your code

        )

  }

}


查看完整回答
反對 回復 2018-12-13
  • 1 回答
  • 0 關注
  • 703 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號