![項(xiàng)目實(shí)戰(zhàn)瑞客lesson6_第1頁(yè)](http://file4.renrendoc.com/view8/M00/2C/3F/wKhkGWcMcVCAFYqkAACoccSh-j0087.jpg)
![項(xiàng)目實(shí)戰(zhàn)瑞客lesson6_第2頁(yè)](http://file4.renrendoc.com/view8/M00/2C/3F/wKhkGWcMcVCAFYqkAACoccSh-j00872.jpg)
![項(xiàng)目實(shí)戰(zhàn)瑞客lesson6_第3頁(yè)](http://file4.renrendoc.com/view8/M00/2C/3F/wKhkGWcMcVCAFYqkAACoccSh-j00873.jpg)
![項(xiàng)目實(shí)戰(zhàn)瑞客lesson6_第4頁(yè)](http://file4.renrendoc.com/view8/M00/2C/3F/wKhkGWcMcVCAFYqkAACoccSh-j00874.jpg)
![項(xiàng)目實(shí)戰(zhàn)瑞客lesson6_第5頁(yè)](http://file4.renrendoc.com/view8/M00/2C/3F/wKhkGWcMcVCAFYqkAACoccSh-j00875.jpg)
版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
項(xiàng)目實(shí)戰(zhàn)項(xiàng)目實(shí)戰(zhàn)whydva、項(xiàng)目實(shí)戰(zhàn)項(xiàng)目實(shí)戰(zhàn)whydva、roadhog理解UseumiwithlayoutHash路由Hash路由Antdumireactwhy開(kāi)箱即用,內(nèi)置react、react-router完善的插件體系splitting等支持靜態(tài)頁(yè)面導(dǎo)出開(kāi)發(fā)啟動(dòng)快dllumireactwhy開(kāi)箱即用,內(nèi)置react、react-router完善的插件體系splitting等支持靜態(tài)頁(yè)面導(dǎo)出開(kāi)發(fā)啟動(dòng)快dllhard-source-webpack-plugin等一鍵兼容到IE9umi-plugin-融合duckdirectorymodel的自動(dòng)加載、codesplittingroadhogroadhogwebpackwebpackumiroadhog路由,思路類(lèi)似React開(kāi)發(fā)dvaumiroadhog之間并umi+dvadvareduxredux-saga的數(shù)據(jù)流方案,然后為了簡(jiǎn)化開(kāi)發(fā)體驗(yàn),dvareact-router和dva易學(xué)易用6apiredux用戶(hù)尤其友好,umidvareduxredux-saga的數(shù)據(jù)流方案,然后為了簡(jiǎn)化開(kāi)發(fā)體驗(yàn),dvareact-router和dva易學(xué)易用6apiredux用戶(hù)尤其友好,umi使用0elm概念reducers,e"ectssubscriptions插件機(jī)制dva-loadingloading,babel-plugin-dva-components、routesmodelsHMR1.Page作輸入,側(cè)重于展示型交互性邏輯ModelPage做數(shù)據(jù)、狀態(tài)的讀DVAredux、redux-sagareact-router的輕量級(jí)前作輸入,側(cè)重于展示型交互性邏輯ModelPage做數(shù)據(jù)、狀態(tài)的讀DVAredux、redux-sagareact-router的輕量級(jí)前e"ect副作用,處理異subscriptionsrouternamespace:model的命名空間,只能用字符串。一model,通過(guò)namespace區(qū)reducerstateaction對(duì)象。action(payload)state。effects:用于處理異步操作(例如:與服務(wù)端交互)action觸發(fā)。但是,它不可stateactionreducerstate actionreducerse"ects的觸發(fā)?,一般是一個(gè)對(duì)象,形如{type:'add',payload:todo,state actionreducerse"ects的觸發(fā)?,一般是一個(gè)對(duì)象,形如{type:'add',payload:todo,typereducer或者e"ect,payload屬性則是數(shù)據(jù)體,用于傳送給reducere"ectUseumiwith自>=umi@2dvaumi-plugin-無(wú)需手寫(xiě)router.jsumimodelcomponent內(nèi)置開(kāi)箱即用dva、dva-loading、react-dom開(kāi)箱即用dva、dva-loading、react-domdva+umisrccomponents組件con!g配置mocktestnode版本node版本新建立一個(gè)空文件夾:mkdirlesson6-進(jìn)入文件夾:cdlesson6-創(chuàng)建:yarncreate安裝依賴(lài):?jiǎn)?dòng):yarnstart或者umi其他例子:如umi-antd-mobile建立pages下面的單頁(yè)面umigpage建立文件夾more(默認(rèn)是建立pages下面的單頁(yè)面umigpage建立文件夾more(默認(rèn)是umigpagemore/index--importrouterfrom'umi/router'umi訪問(wèn)index:訪問(wèn)about:umipagesumigpageimportstylesfromexportumigpageimportstylesfromexportdefaultfunction({match}){return(<div<h1>Pagepath:'/product/:id',component:'./product/$id',umi$umigpageexportdefaultfunction({location,const{id}=match.exportdefaultfunction({location,const{id}=match.params;return(<div<h1>Page<p>{id||'沒(méi)有path:'/channel/:id?',component:'./channel/$id$umi_layout.js_layout.jslayout。layout首先創(chuàng)建umigpage創(chuàng)建父組件umigpageofLayout/_layout創(chuàng)建父組件umigpageofLayout/_layoutexportdefaultfunction(props){return<h1>Pageumigpageexportdefaultfunction(){return(<div<h1>Pageindex</h全局全局exportdefaultfunction(props)return(<Header{props.children<Footer不同的全局layout,umi不支持這樣的配置,但你仍可以在layouts/index.js對(duì)location.pathlayout。/loginexportdefaultfunction(props)if(props.location.exportdefaultfunction(props)if(props.location.pathname===returnreturn<Header{<Footerumiumi/linkReactimportLinkfromexportdefault()=><Linkto="/list">GotolistimportrouterfromfunctiongoToListPage()importrouterfromfunctiongoToListPage(){更多命令式的跳轉(zhuǎn)方法,詳見(jiàn)api#umi/routerumiBrowserHistoryHashexportdefault{history:'hash,使用狀態(tài):state使用狀態(tài):statepagemore/index--importReact,{Component}from'react';import{PageHeaderWrapper}from'@ant-import{Card,Form,Input,Button,Table}from'antd';import{connect}from'dva';importstylesfrom'./index.less';constcolumns=title:'姓名',dataIndextitle:'姓名',dataIndex'name',key:'name',title:'年齡',dataIndex'age',key:'age',title:'住址',dataIndex'city',key:'city',exportdefaultconnec(({more})=>({}),getMoreData:()=>({type:'more/getChannelData'}),getMoreDataBySearch:search=>({type:'more/getChannelDataBySearch',payload:searchclassMoreextendsComponent{componentDidMount(){onFinish=values=>{console.logonFinish=values=>{console.log('values',values);//sy-logonFinishFailed=err=>{console.log('err',err);//sy-logrender()const{data}=ps.more;console.log('oo',thisprops);//sy-logreturn(<PageHeaderWrapper<FormonFinish={this.onFinish}labe="姓名"rulesrequiredtrue,message:'請(qǐng)輸入姓名查詢(xún)'}]}<Inputplaceholder="請(qǐng)輸入姓名更新模型import{getChannelData更新模型import{getChannelData,}fromconstmodel={namespace:'more',state:{data:effects:<Buttontype="primary"<TabledataSource={data}{columns}rowKey="id"*getChannelData({payload},{*getChannelData({payload},{constresponse=yieldcall(getChannelData,payload);yieldtype:'channelData',payload:response,*getChannelDataBySearch({pyload},call,put}){constresponse=call(getChannelDataBySearch,console.log('has,response,pyieldtype:'channelData,payload:response,reducers:channelData(state,{payloadreturn{...state,data:[...payload.data]})exportdefault importrequestexportdefault importrequestfrom'@/utils/request';exportasyncfunctiongetChannelData(params)returnrequest('/api/getChannelData',{method:'get',exportasyncfunctiongetChannelDataBySearch(params){method:'post',data:mock目錄和src平級(jí),新建constchannelTableData=[];for(leti=0;i<10;i++){id:i,name'名字age:city'城市city'城市functionsearchChannelData(name){constres=[];for(leti=0;i<10;i++)if>
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年企業(yè)市場(chǎng)營(yíng)銷(xiāo)宣傳協(xié)議
- 2025年傳統(tǒng)工藝振興戰(zhàn)略諒解協(xié)議
- 2025年中學(xué)食品安全監(jiān)管協(xié)議
- 2025年公共環(huán)境策劃改善協(xié)議
- 2025年導(dǎo)師學(xué)員攜手共進(jìn)協(xié)議書(shū)
- 2025年度股權(quán)合伙財(cái)產(chǎn)分割協(xié)議范例
- 江蘇省2025年土地使用權(quán)互換合同
- 2025年臨時(shí)辦公設(shè)施租賃合同
- 2025年企業(yè)股權(quán)融資協(xié)議書(shū)規(guī)范文本
- 2025年商業(yè)地產(chǎn)合作協(xié)議標(biāo)準(zhǔn)版
- 健康檔案模板
- 購(gòu)買(mǎi)演唱會(huì)門(mén)票的合同模板
- DB32-T 4790-2024建筑施工特種作業(yè)人員安全操作技能考核標(biāo)準(zhǔn)
- 2022年安徽阜陽(yáng)太和縣人民醫(yī)院本科及以上學(xué)歷招聘筆試歷年典型考題及考點(diǎn)剖析附帶答案詳解
- 頂管工程施工及驗(yàn)收技術(shù)標(biāo)準(zhǔn)
- 【基于現(xiàn)金流的企業(yè)財(cái)務(wù)風(fēng)險(xiǎn)探究文獻(xiàn)綜述4100字】
- TD/T 1036-2013 土地復(fù)墾質(zhì)量控制標(biāo)準(zhǔn)(正式版)
- 安全警示教育的會(huì)議記錄內(nèi)容
- 2024年度-銀行不良清收技巧培訓(xùn)課件(學(xué)員版)
- 燃燒爆炸理論及應(yīng)用 課件 第1-3章 緒論、燃燒及其災(zāi)害、物質(zhì)的燃燒
- 裝飾裝修施工新工藝
評(píng)論
0/150
提交評(píng)論