鍍金池/ 問答/HTML/ 為什么account 組件沒有被渲染出來

為什么account 組件沒有被渲染出來

clipboard.png

clipboard.png

return <div>

        <Link to="/" style={{background:'red',width:10,height:10,display:'block'}}>
            </Link>
            <div className={styles.nav}>

                <li>
                    <Link to="/home/account">
                    <img src={account}/>
                    account</Link>
                </li>
                <li>
                    <Link to="/home/mining">mining</Link>
                </li>
                <li>
                    <Link to="/home/price">price</Link>
                </li>
                <li>
                    <Link to="/home/chat">Chat</Link>
                </li>
                <li>
                    <Link to="/home/setting">Setting</Link>
                </li>
                <li>
                    <Link to="/home/help">help</Link>
                </li>
            </div>
            <div>
                <Switch>
                    <Route path="/home/account" exact component={Account}></Route>
                    <Route path="/home/mining" component={Mining}></Route>
                    <Route path="/home/price" component={Price}></Route>
                    <Route path="/home/chat" component={Chat}></Route>
                    <Route path="/home/setting" component={Setting}></Route>
                    <Route path="/home/help" component={Help}></Route>
                </Switch>
            </div>
    </div>
回答
編輯回答
離觴

加個withRouter試試https://reacttraining.com/rea...

2018年2月25日 20:00
編輯回答
萌吟

去掉exact

2018年8月9日 06:40
編輯回答
舊酒館

粗略估計 你現(xiàn)在的地址是在/下 不是在/home/account

2017年9月24日 20:02