{"id":13671860,"url":"https://github.com/zhangfan6644777/Redux-cnode","last_synced_at":"2025-04-27T18:31:50.826Z","repository":{"id":128410212,"uuid":"84382341","full_name":"zhangfan6644777/Redux-cnode","owner":"zhangfan6644777","description":"react+react-router+redux+es6+antd-mobile+webpack版本的Cnode ","archived":false,"fork":false,"pushed_at":"2017-05-22T11:20:56.000Z","size":967,"stargazers_count":96,"open_issues_count":2,"forks_count":29,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-11T09:44:12.593Z","etag":null,"topics":["antd-mobile","es6","fetch","less","react","react-router","redux","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhangfan6644777.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-09T01:11:04.000Z","updated_at":"2023-02-10T02:59:12.000Z","dependencies_parsed_at":"2024-01-14T17:05:04.406Z","dependency_job_id":"2a306ac8-4817-4cf0-8b57-4b2bbbd80c97","html_url":"https://github.com/zhangfan6644777/Redux-cnode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangfan6644777%2FRedux-cnode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangfan6644777%2FRedux-cnode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangfan6644777%2FRedux-cnode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangfan6644777%2FRedux-cnode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhangfan6644777","download_url":"https://codeload.github.com/zhangfan6644777/Redux-cnode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187325,"owners_count":21549618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antd-mobile","es6","fetch","less","react","react-router","redux","webpack"],"created_at":"2024-08-02T09:01:20.474Z","updated_at":"2025-04-27T18:31:48.454Z","avatar_url":"https://github.com/zhangfan6644777.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"楼主身为一个非计算机专业的大四学生,目前在学校附近的公司实习,利用工作之余做的第一个redux项目,也是刚刚接触redux 1个月,从最开始的看不懂到现在的能稍微写点东西出来了,希望各位大神觉得哪里做的不好,不足的地方,还请各位批评指正,非常感谢.同时也是求star!!!!\n# 项目介绍\n基于webpack + react + react-router + redux + less + ant + es6 的cnode社区\n非常感谢cnode提供的api以及react china社区的各位大神,真的提供了很多的帮助,里面也有很多的例子,都值得去学习\n## 运行项目（nodejs 6.0+）\n```\n  git clone https://github.com/zhangfan6644777/Redux-cnode.git\n  cd Redux-cnode\n  npm install \n  npm run dev (开发版本访问：http://localhost:8088/)\n```\n\n## 功能\n```\n  1.登录退出\n  2.列表分页，下拉自动加载\n  3.发帖，回复帖子,点赞\n  4.查看消息\n  5.个人中心\n  6.查看别人的资料\n```\n## 项目总结\n\n1.```基本思路```就是每个页面对应一个reducer\n\n- ```Topic```主要是主页的列表信息,上拉加载\n- ```Article```对应文章内容页面,点赞,评论,关注的逻辑都在这里\n- ```PublishTopic```对应发布文章页面,\n- ```Message```对应账号的消息页面,包括已读消息和未读消息\n- ```Login```对应账号的登录信息\n- ```UserInfo```个人信息,还有发布,收藏,参与的话题\n- ```OtherInfo```对应账号的信息,还有发布,收藏,参与的话题\n\n2.代码结构我是模仿[实例讲解基于 React+Redux 的前端开发流程](https://segmentfault.com/a/1190000005356568)去构建的,他的这篇文章我觉得写得非常好,通俗易懂.尤其是对于我这样的小白来说,代码的结构也很容易理解,非常感谢这篇文章带我入门redux,然后这个是我根据这个文章写的demo [Redux-PickApple](https://github.com/zhangfan6644777/Redux-PickApple),欢迎star!!\n\n3.引用了蚂蚁金服的移动端Antd,样式挺好看的,不用再自己造轮子,ui一部分是模仿[大神的cnode](http://react-china.org/t/webpack-react-react-router-redux-less-flex-css-es6-react-cnode/6332)去做的\n\n4.redux听起来确实很高大上,主要是对我开发思维的一个改变,但是有时候我觉得实施起来确实有点复杂,可能是我刚接触redux,还不是特别理解。\n\n5.react配合redux非常需要注意性能，一定要尽可能减少渲染的次数,逻辑处理的不好,会导致多次的渲染,所以要好好利用shouldComponentUpdate来提升性能(需要改进的地方)\n\n6.对react有了进一步的了解\n\n- setState()是异步的 this.setState()会调用render方法，但并不会立即改变state的值，state是在render方法中赋值的。所以执行this.setState()后立即获取state的值是不变的。同样的直接赋值state并不会出发更新，因为没有调用render函数。\n- 在组件里面最好不要写自己的state,应该放在根state统一进行管理,但是有些时候我觉得放在本身组件内代码写着会简单一点(TTTTTTTTTTTT)。\n\n7.react-router\n\n- 可以使用下面代码优雅的传递复杂的参数\n\n  ```\n  \u003cLink to={{pathname:link,state:data}}\u003e\n  ```\n\n8.对es6有了进一步的了解,推荐阮大神的书籍[ECMAScript 6 入门](http://es6.ruanyifeng.com/) \n\n- class写法 如果使用es6的class类继承react的component组件，constructor中必须调用super，因为子类需要用super继承component的this，否则实例化的时候会报错。\n- 方法要绑定bind(this)才可以使用,与es5的React.createClass不同,es5的方式是自动绑定到this上的。\n- 其中箭头函数 扩展运算符和变量解构赋值真的帮助很大,极大的提升效率。\n\n9.目前还没有解决的问题(正在改进中)\n\n- 评论的时候滚动条\n- 在消息页面点击被删除的帖子会出错\n### 截图\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/1.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/2.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/3.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/4.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/5.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/6.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/7.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/8.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/9.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/10.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/11.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/12.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/13.png)\n\n![截图](https://github.com/zhangfan6644777/Redux-cnode/blob/master/show/14.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangfan6644777%2FRedux-cnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhangfan6644777%2FRedux-cnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangfan6644777%2FRedux-cnode/lists"}