1234567891011121314151617181920212223242526272829303132333435363738 |
- <template>
- <div>
- <router-view></router-view>
- </div>
- </template>
- <script>
- import { ref, onMounted } from "vue"
- export default {
- name: 'App',
- setup() {
- onMounted(() => {
- document.title = 'SCD检测'
- // 创建一个 link 元素
- const link = document.createElement('link');
- link.rel = 'icon';
- link.type = 'image/x-icon';
- link.href = '../../assets/icon/Avatar.png'; // 替换为你的图标路径
- // 获取当前文档中原有的 link 元素
- const existingLink = document.querySelector('link[rel="icon"]');
- // 如果存在原有的 link 元素,则替换它;否则,将新创建的 link 元素添加到 head 中
- if (existingLink) {
- document.head.removeChild(existingLink);
- }
- document.head.appendChild(link);
- })
- },
- components: {
- }
- }
- </script>
- <style>
- body {
- margin: 0;
- background-color: #FFF;
- }
- </style>
|