App.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <script lang="ts">
  2. import { ref, defineComponent, reactive, toRefs, watch, onMounted } from "vue";
  3. import useProjectStore from "@/store/useProjectStore";
  4. export default defineComponent({
  5. setup() {
  6. const projectStore = useProjectStore();
  7. onMounted(() => {
  8. //这两个请求不能写在这里 因为router.beforeEach 发生在后面,获取不到projectId
  9. // projectStore.setWeather();
  10. // projectStore.setProjectObj();
  11. });
  12. // projectStore.$subscribe((mutation, state) => {
  13. // console.log("projectStore--state222", mutation);
  14. // // console.log("projectStore--state222", mutation, JSON.stringify(state));
  15. // });
  16. // watch(projectStore.$state, (nstate, ostate) => {
  17. // console.log('watch-state',JSON.stringify(nstate) , JSON.stringify(ostate));
  18. // // debugger;
  19. // });
  20. },
  21. });
  22. </script>
  23. <template>
  24. <router-view></router-view>
  25. </template>
  26. <style scoped lang="scss">
  27. #app {
  28. font-family: Avenir, Helvetica, Arial, sans-serif;
  29. -webkit-font-smoothing: antialiased;
  30. -moz-osx-font-smoothing: grayscale;
  31. // background: #f3fdff;
  32. // text-align: center;
  33. // color: #2c3e50;
  34. // margin-top: 60px;
  35. }
  36. </style>