App.vue 720 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <script>
  2. import Api from "./@/http/Api.js";
  3. export default {
  4. data() {
  5. return {
  6. // globalData: {},
  7. }
  8. },
  9. methods:{
  10. getDictAll() {
  11. Api.getDictList().then((res) => {
  12. console.log(res)
  13. window.SITE_CONFIG["dictList"] = res.data;
  14. });
  15. },
  16. },
  17. onLaunch: function() {
  18. // 获取字典列表, 添加并全局变量保存
  19. this.getDictAll();
  20. },
  21. onShow: function() {
  22. console.log('App Show')
  23. },
  24. onHide: function() {
  25. console.log('App Hide')
  26. }
  27. }
  28. </script>
  29. <style lang="scss">
  30. /*每个页面公共css */
  31. @import "@/uni_modules/uview-ui/index.scss";
  32. uni-page-body,html,body{
  33. height: 100%;
  34. width: 750rpx;
  35. background: #F6F6F6;
  36. }
  37. </style>