wepy framework stepped pit diary - against the war

1.methods

  • bind can only be declared a page, catch an event, you can not declare custom methods
  • Custom methods should follow methods same level

2.wepy open promise

- When you create a template in wepy framework, and does not turn promise, to open asynchronous, we need to be installed in the root directory:

npm install wepy-async-function -S

- app.wpy then introduced in the
import 'wepy-async-function' ;

After introduction opening app.wpy promise in the
constructor () {
Super ();
this.use ( 'promisify');
}
attention must be turned on app.wpy, the opening will be given in the page
_this.use () is not a function

3. acquiring asynchronous data
using the page promise acquire asynchronous data, asynchronous data directly to render the page, the data can not be displayed
using this. $ Apply () method
Here Insert Picture Description

this.apply () usage scene
1. asynchronous update data
2. Manual refresh dom

Published an original article · won praise 0 · Views 11

Guess you like

Origin blog.csdn.net/qq_40545204/article/details/104450403
Recommended