摘要: 如果不对reducer进行拆分,当项目越来越大时,就会变得极难维护。Redux 提供了一个combineReducers方法,用于 Reducer 的拆分。你只要定义各个子 Reducer 函数,然后用这个方法,将它们合成一个大的 Reducer。 一.从redux中引入combineReducer 阅读全文
posted @ 2019-07-02 22:07 zhanyoulin 阅读(1275) 评论(0) 推荐(0) 编辑
摘要: 1.单行文本溢出显示省略号 @mixin no-wrap() { overflow: hidden; -ms-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; } @mixin no-wrap() { ove 阅读全文
posted @ 2019-06-24 14:42 zhanyoulin 阅读(948) 评论(0) 推荐(0) 编辑
摘要: 1、编译环境不一样Sass需要安装Ruby,属于服务端处理,然而Less是需要引入官网提供和的less.js,属于客户端处理。 2、变量声明不一样Sass/Scss 使用的是$,而Less使用的是@ // Sass$lightColor:#baf;// Less@lightColor:#baf;3、 阅读全文
posted @ 2019-06-24 13:05 zhanyoulin 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 一.安装 yarn add redux yarn add react-redux 二. 在最外层容器中,把所有内容包裹在 Provider 组件中,将之前创建的 store 作为 prop 传给 Provider 三. 在组件中引入connect : import { connect } from 阅读全文
posted @ 2019-06-20 10:46 zhanyoulin 阅读(189) 评论(0) 推荐(0) 编辑