App.vue 552 B

1234567891011121314151617181920212223242526272829
  1. <script>
  2. export default {
  3. // 此处globalData为了演示其作用,不是uView框架的一部分
  4. globalData: {
  5. username: '白居易'
  6. },
  7. onLaunch() {
  8. this.$store.dispatch('getUserInfo').then(res=>{
  9. console.log(res)
  10. }).catch(e=>{
  11. console.log('未登录')
  12. });
  13. uni.getSystemInfo({
  14. success:res=>{
  15. console.log(res)
  16. this.$store.commit('setSystemInfo', res);
  17. }
  18. })
  19. }
  20. };
  21. </script>
  22. <style lang="scss">
  23. @import 'uview-ui/index.scss';
  24. @import 'common/demo.scss';
  25. .container {
  26. min-height: 100vh;
  27. }
  28. </style>