cqupt-yifanwu / blog Goto Github PK
View Code? Open in Web Editor NEWreact+react router+node(express)+mongodb+webpack 栈
License: MIT License
react+react router+node(express)+mongodb+webpack 栈
License: MIT License
history属性用来监听浏览器地址栏的变换,并将URL解析成一个对象,供React-Router匹配 history对象有三个属性browserHistory,hashHistory,creacteMemoryHistory
webpack中不太能处理html中引用图片
为了解决MVC数据流混乱的问题flux被提出,它的核心**就是数据和逻辑永远单项流动。数据从action到dispatcher,再到store,最终到view的路线是单向不可逆的。dispatcher定义了严格的规则来限定我们对数据的修改操作;store中不能暴露setter的设定也强化了输一局修改的纯洁性,保证了store的数据确定唯一的状态。其中flux有三大部分构成:
在这个结构中类似MVC但是不存在一个controller,但是却像是存在一个controller-view。主要进行store与react组件(view)之间的绑定,定义数据已经更新传递方式,它会调用store的getter获取其中的数据并设置为自己的state,然后调用setState.
在flux中我们在actionCreator里面调用AppDispatcher.dispath方法来触发action,这样不仅有冗余而且直接修改了store中的数据,将无法保存数据前后变化的状态。在react中采用纯函数reducer来修改状态。
HI 我也在寻找react与express之间的配合。刚看了你的代码,有点疑问:
1)当请求的是主页的时候,app.js中app.use('/', routes);是如何自动跳转到public中的index.html文件的?
2)app.use('/', routes);中的routes中定义的是res.render('index', { title: 'Express' });,但是该行并没有执行,是什么原因来着?
说好的在线预览呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.