Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leijing7/wx-mina-meteor
一个微信小程序通过 DDP 协议和 Meteor 后端交换数据的简单例子
https://github.com/leijing7/wx-mina-meteor
Last synced: 2 months ago
JSON representation
一个微信小程序通过 DDP 协议和 Meteor 后端交换数据的简单例子
- Host: GitHub
- URL: https://github.com/leijing7/wx-mina-meteor
- Owner: leijing7
- Created: 2016-10-04T16:57:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T07:08:43.000Z (over 7 years ago)
- Last Synced: 2024-08-02T03:01:22.687Z (5 months ago)
- Language: JavaScript
- Size: 2.13 MB
- Stars: 32
- Watchers: 2
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-wechat-weapp - wx-mina-meteor - 一个 meteor 的 React todo list 例子 (Demo)
- awesome-github-wechat-app - wx-mina-meteor - 一个 meteor 的 React todo list 例子 (Demo)
README
#### simple-todos-react
是一个 meteor 的 React todo list 例子。我有一点改动,主要是在插入时需要用户登录改为了不用登录就可以添加新任务,这样小程序就可以添加新任务而不用登录。把 simple-todos-react/imports/api/tasks.js 里的 Meteor.methods 插入函数改为如下
```
'tasks.insert'(text) {
check(text, String);// Make sure the user is logged in before inserting a task
// if (! this.userId) {
// throw new Meteor.Error('not-authorized');
// }const username = Meteor.users.findOne(this.userId) ? Meteor.users.findOne(this.userId).username : "anonymous"
Tasks.insert({
text,
createdAt: new Date(),
owner: this.userId,
username: username,
});
},
```这样才能在小程序端插入新的事项。
#### webpacks
是二次打包代码和已经打包好的#### wx
是微信小程序代码![微信小程序 Reactive UI](https://github.com/leijing7/wx-mina-meteor/blob/master/static/mina.gif)