Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charleyw/wechat-weapp-redux-todos
微信小程序,集成redux
https://github.com/charleyw/wechat-weapp-redux-todos
redux-devtools weapp wechat-weapp-redux
Last synced: 3 months ago
JSON representation
微信小程序,集成redux
- Host: GitHub
- URL: https://github.com/charleyw/wechat-weapp-redux-todos
- Owner: charleyw
- License: mit
- Created: 2016-09-28T09:20:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T12:18:30.000Z (about 2 years ago)
- Last Synced: 2024-08-03T02:02:47.419Z (6 months ago)
- Topics: redux-devtools, weapp, wechat-weapp-redux
- Language: JavaScript
- Size: 2.71 MB
- Stars: 249
- Watchers: 12
- Forks: 96
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-wechat-app - wechat-weapp-redux-todos - 微信小程序集成Redux实现的Todo list (Demo)
- awesome-github-wechat-weapp - wechat-weapp-redux-todos - 微信小程序集成Redux实现的Todo list (Demo)
README
微信小程序集成Redux实现的Todo list
======================
在微信小程序中使用[Redux](https://github.com/reactjs/redux)实现Todo list,同时集成了redux-devtools![remote-redux-devtools](./remote-redux-devtools.gif)
使用了我自己写的小程序的Redux绑定库:[wechat-weapp-redux](https://github.com/charleyw/wechat-weapp-redux)
### 使用
导入到微信的开发工具目录指向`src`运行就可以了。
### 开启redux-devtools
**需要打开小程序开发工具的配置中`项目`->`基础信息`->`开发环境不校验请求域名以及 TLS 版本 `**
![weapp-config](./weapp-config.png)
1. 把本项目根目录下的libs拷贝到`src/libs`中
2. 修改`src/configureStore`, 改成这样:
```
const {createStore, compose} = require('./libs/redux.js');
const devTools = require('./libs/remote-redux-devtools.js').default;
const reducer = require('./reducers/index.js')// function configureStore() {
// return createStore(reducer);
// }
function configureStore() {
return createStore(reducer, compose(devTools({
hostname: 'localhost',
port: 5678,
secure: false
})));
}module.exports = configureStore;
```1. 本地安装remotedev-server并启动
```shell
npm install -g remotedev-server
remotedev --hostname=localhost --port=5678
```2. 浏览器中访问**localhost:5678**
如果不能访问,可以尝试使用**http://remotedev.io/local/**,打开后点击下面的setting,设置使用本地的server。### Todos
* 集成redux-undo
* 集成redux-persist## Liscense
© 2016 Wang Chao. This code is distributed under the MIT license.