index.js 524 B

123456789101112131415161718192021222324
  1. import {
  2. observable,
  3. action
  4. } from "mobx-miniprogram"
  5. export const store = observable({
  6. userPhone: 111,
  7. // tabbar页面
  8. active: 0,
  9. // 页面高度
  10. pageHeight: 0,
  11. //userInfo
  12. userInfo: {},
  13. get Guser() {},
  14. // 方法
  15. upDateActive: action(function (index) {
  16. this.active = index
  17. }),
  18. setPageHeight: action(function (num) {
  19. this.pageHeight = num
  20. }),
  21. setUserInfo: action(function (obj) {
  22. this.userInfo = JSON.parse(JSON.stringify(obj))
  23. })
  24. })