Guest User

Untitled

a guest
May 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. import wepy from 'wepy';
  2. // export default class MyPage extends wepy.page {
  3. export default class MyComponent extends wepy.component {
  4. customData = {} // 自定义数据
  5. customFunction () {} //自定义方法
  6. onLoad () {} // 在Page和Component共用的生命周期函数
  7. onShow () {} // 只在Page中存在的页面生命周期函数
  8. config = {}; // 只在Page实例中存在的配置数据,对应于原生的page.json文件
  9. data = {}; // 页面所需数据均需在这里声明,可用于模板数据绑定
  10. components = {}; // 声明页面中所引用的组件,或声明组件中所引用的子组件
  11. mixins = []; // 声明页面所引用的Mixin实例
  12. computed = {}; // 声明计算属性(详见后文介绍)
  13. watch = {}; // 声明数据watcher(详见后文介绍)
  14. methods = {}; // 声明页面wxml中标签的事件处理函数。注意,此处只用于声明页面wxml中标签的bind、catch事件,自定义方法需以自定义方法的方式声明
  15. events = {}; // 声明组件之间的事件处理函数
  16. }
Add Comment
Please, Sign In to add comment