Mark.vue 788 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <h1>展示新前端获取setting的结果</h1>
  3. <div>
  4. setting:
  5. <pre> {{ store.setting }}</pre>
  6. </div>
  7. </template>
  8. <script lang="ts">
  9. import { reactive, defineComponent, onMounted, toRefs } from "vue";
  10. import { getSetting } from "@/api/markPage";
  11. import { store } from "@/store";
  12. export default defineComponent({
  13. name: "Mark",
  14. setup: () => {
  15. async function updateSetting() {
  16. const settingRes = await getSetting();
  17. store.setting = settingRes.data;
  18. }
  19. onMounted(() => {
  20. updateSetting();
  21. });
  22. return { store };
  23. },
  24. });
  25. </script>
  26. <style scoped>
  27. a {
  28. color: #42b983;
  29. }
  30. label {
  31. margin: 0 0.5em;
  32. font-weight: bold;
  33. }
  34. code {
  35. background-color: #eee;
  36. padding: 2px 4px;
  37. border-radius: 4px;
  38. color: #304455;
  39. }
  40. </style>