• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
    問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
    當前位置: 首頁 - 科技 - 知識百科 - 正文

    react-router4 嵌套路由的使用方法

    來源:懂視網 責編:小采 時間:2020-11-27 22:34:07
    文檔

    react-router4 嵌套路由的使用方法

    react-router4 嵌套路由的使用方法:react我自己還在摸索學習中,今天正好學習一下react-router4 嵌套路由的使用方法,順便留著筆記 先直接貼代碼 import React from 'react'; import ReactDOM from 'react-dom'; import { HashRouter as Router, Rout
    推薦度:
    導讀react-router4 嵌套路由的使用方法:react我自己還在摸索學習中,今天正好學習一下react-router4 嵌套路由的使用方法,順便留著筆記 先直接貼代碼 import React from 'react'; import ReactDOM from 'react-dom'; import { HashRouter as Router, Rout

    react我自己還在摸索學習中,今天正好學習一下react-router4 嵌套路由的使用方法,順便留著筆記

    先直接貼代碼

    import React from 'react';
    import ReactDOM from 'react-dom';
    import { HashRouter as Router, Route, Switch} from 'react-router-dom';
    import createBrowserHistory from 'history/createBrowserHistory';
    import UserAddPage from './pages/UserAdd/index';
    import HomePage from './pages/Home/index';
    import HomeLayout from './components/HomeLayout/index';
    
    const hashHistory = createBrowserHistory();
    const NoMatch = ({ location }) => (
     <div>
     <h3>無法匹配 <code>{location.pathname}</code></h3>
     </div>
    )
    ReactDOM.render((
     <Router history={hashHistory}>
     <div>
     <HomeLayout>//總會加載這個組件,并且下面 swicth 里面的組件會在它里面 render 
     <Switch>
     <Route path="/" exact component={HomePage}/>
     <Route path="/user/add" component={UserAddPage}/>
     <Route component={NoMatch}/>
     </Switch>
     </HomeLayout>
     </div>
     </Router>
    ), document.getElementById('root'));
    

    參考文章:https://stackoverflow.com/questions/42095600/nested-routes-in-v4

    聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    react-router4 嵌套路由的使用方法

    react-router4 嵌套路由的使用方法:react我自己還在摸索學習中,今天正好學習一下react-router4 嵌套路由的使用方法,順便留著筆記 先直接貼代碼 import React from 'react'; import ReactDOM from 'react-dom'; import { HashRouter as Router, Rout
    推薦度:
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 8050免费午夜一级国产精品| 国产午夜精品久久久久九九电影 | 久久精品亚洲男人的天堂 | 亚洲精品第一国产综合境外资源| 色偷偷888欧美精品久久久| 久久国产精品成人影院| 亚洲国产91精品无码专区| 国产精品嫩草影院一二三区| 精品视频一区二区三区免费| 人妻精品久久久久中文字幕一冢本| 久久精品国产一区二区 | 无码精品国产一区二区三区免费 | 国产精品 视频一区 二区三区| 国产女人精品视频国产灰线| 亚洲精品国产精品乱码不卞| 久久夜色撩人精品国产| 国产精品毛片一区二区| 99久久www免费人成精品| 亚洲国产精品热久久| 99精品高清视频一区二区| 久久精品国产亚洲av日韩| 一本久久精品一区二区| 亚洲精品和日本精品| 亚洲精品国产日韩无码AV永久免费网| 久久99热这里只有精品国产 | 杨幂国产精品福利在线观看| 成人无码精品1区2区3区免费看| 亚洲国产精品SSS在线观看AV | 久久精品国产精品亚洲艾草网美妙| 99热成人精品免费久久| 69堂午夜精品视频在线| 嫩草影院久久国产精品| 久久国产精品一区二区| 国产精品手机在线| 日本一区二区三区精品中文字幕| 久久精品成人免费网站| 国产精品久久网| 国产亚洲美女精品久久久久狼 | 国产成人精品日本亚洲| 99精品人妻无码专区在线视频区 | 国内精品久久久久伊人av|