From cc40ecd35d8fad49ba0e8ed046e479a5523c8b8a Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Thu, 16 Oct 2025 09:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E9=97=AA=E5=B1=8F=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/index/index.vue | 43 +--------------------------------- app/pages/index.vue | 30 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 42 deletions(-) diff --git a/app/components/index/index.vue b/app/components/index/index.vue index 61455cf..9208379 100644 --- a/app/components/index/index.vue +++ b/app/components/index/index.vue @@ -4,49 +4,9 @@ import { iotSolutionsData, multiScenarioData, softwareDevelopmentData, - smartHardwareData, - pageConfig + smartHardwareData } from '~/data/indexData' -// 动态加载资源 -const loadResources = () => { - // 加载CSS - pageConfig.cssFiles.forEach(href => { - if (!document.querySelector(`link[href="${href}"]`)) { - const link = document.createElement('link') - link.rel = 'stylesheet' - link.href = href - link.type = 'text/css' - document.head.appendChild(link) - } - }) - - // 加载JS - pageConfig.jsFiles.forEach(src => { - if (!document.querySelector(`script[src="${src}"]`)) { - const script = document.createElement('script') - script.src = src - script.type = 'text/javascript' - document.head.appendChild(script) - } - }) - - // 添加favicon - if (!document.querySelector('link[rel="shortcut icon"]')) { - const link = document.createElement('link') - link.rel = 'shortcut icon' - link.href = pageConfig.favicon - document.head.appendChild(link) - } - - // 加载百度统计 - const protocol = window.location.protocol === 'https:' ? 'https://' : 'http://' - const script = document.createElement('script') - script.src = `${protocol}hm.baidu.com/h.js?${pageConfig.baiduAnalytics}` - script.type = 'text/javascript' - document.head.appendChild(script) -} - // 处理锚点链接 const handleAnchorLinks = () => { if (window.location.hash) { @@ -86,7 +46,6 @@ const handleDropdownImageHover = (index: number) => { } onMounted(() => { - loadResources() handleAnchorLinks() // 绑定事件 diff --git a/app/pages/index.vue b/app/pages/index.vue index f92370f..88467b6 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,4 +1,34 @@