Ver código fonte

修改topbar

凉纪 2 anos atrás
pai
commit
c171f563dd
2 arquivos alterados com 10 adições e 24 exclusões
  1. 5 23
      src/views/home/isMy.vue
  2. 5 1
      src/views/home/works.vue

+ 5 - 23
src/views/home/isMy.vue

@@ -5,37 +5,19 @@
 </template>
 
 <script>
-// 请求接口
-import { getUserInfo } from '@/api/login.js'
-import { mapGetters } from 'vuex'
+import TopBar from '@/components/TopBar'
 export default {
+  components: { TopBar },
   data() {
     return {
-      wechat: `${this.$cdn}/wx/640.gif`
+
     }
   },
-  computed: {
-    ...mapGetters(['userName'])
-  },
   mounted() {
-    this.initData()
+
   },
   methods: {
-    // 请求数据案例
-    initData() {
-      // 请求接口数据,仅作为展示,需要配置src->config下环境文件
-      const params = { user: 'sunnie' }
-      getUserInfo(params)
-        .then(() => {})
-        .catch(() => {})
-    },
-    // Action 通过 store.dispatch 方法触发
-    doDispatch() {
-      this.$store.dispatch('setUserName', '真乖,赶紧关注公众号,组织都在等你~')
-    },
-    goGithub() {
-      window.location.href = 'https://github.com/sunniejs/vue-h5-template'
-    }
+
   }
 }
 </script>

+ 5 - 1
src/views/home/works.vue

@@ -5,7 +5,11 @@
 </template>
 
 <script >
-
+import TopBar from '@/components/TopBar'
+import {mapGetters} from "vuex";
+export default {
+  components: { TopBar },
+}
 
 </script>