App.vue 915 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <div>
  3. <router-view></router-view>
  4. </div>
  5. </template>
  6. <script>
  7. import { ref, onMounted } from "vue"
  8. export default {
  9. name: 'App',
  10. setup() {
  11. onMounted(() => {
  12. document.title = 'SCD检测'
  13. // 创建一个 link 元素
  14. const link = document.createElement('link');
  15. link.rel = 'icon';
  16. link.type = 'image/x-icon';
  17. link.href = '../../assets/icon/Avatar.png'; // 替换为你的图标路径
  18. // 获取当前文档中原有的 link 元素
  19. const existingLink = document.querySelector('link[rel="icon"]');
  20. // 如果存在原有的 link 元素,则替换它;否则,将新创建的 link 元素添加到 head 中
  21. if (existingLink) {
  22. document.head.removeChild(existingLink);
  23. }
  24. document.head.appendChild(link);
  25. })
  26. },
  27. components: {
  28. }
  29. }
  30. </script>
  31. <style>
  32. body {
  33. margin: 0;
  34. background-color: #FFF;
  35. }
  36. </style>