App.vue 1.0 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. watch(projectStore.$state, (nstate, ostate) => {
  13. //console.log(nstate.projectId, ostate.projectId);
  14. // debugger;
  15. });
  16. },
  17. });
  18. </script>
  19. <template>
  20. <router-view></router-view>
  21. </template>
  22. <style scoped lang="scss">
  23. #app {
  24. font-family: Avenir, Helvetica, Arial, sans-serif;
  25. -webkit-font-smoothing: antialiased;
  26. -moz-osx-font-smoothing: grayscale;
  27. // background: #f3fdff;
  28. // text-align: center;
  29. // color: #2c3e50;
  30. // margin-top: 60px;
  31. }
  32. </style>