index.vue 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="content">
  3. <image class="logo" :src="logoimg"></image>
  4. <view class="text-area">
  5. <text class="title">{{title}}</text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import { mapGetters } from 'vuex';
  11. export default {
  12. data() {
  13. return {
  14. title: 'Hello'
  15. }
  16. },
  17. computed: {
  18. imgPath() {
  19. return this.$store.state.imgpath
  20. },
  21. ...mapGetters(['logoimg']),
  22. },
  23. watch: {
  24. logoimg: {
  25. immediate: true, // 页面一进入就检查一次
  26. handler(val) {
  27. return val
  28. }
  29. },
  30. },
  31. onLoad() {
  32. },
  33. methods: {
  34. }
  35. }
  36. </script>
  37. <style>
  38. .content {
  39. display: flex;
  40. flex-direction: column;
  41. align-items: center;
  42. justify-content: center;
  43. }
  44. .logo {
  45. height: 200rpx;
  46. width: 200rpx;
  47. margin-top: 200rpx;
  48. margin-left: auto;
  49. margin-right: auto;
  50. margin-bottom: 50rpx;
  51. }
  52. .text-area {
  53. display: flex;
  54. justify-content: center;
  55. }
  56. .title {
  57. font-size: 36rpx;
  58. color: #8f8f94;
  59. }
  60. </style>