闪屏修复-其他

This commit is contained in:
WindowBird 2025-10-16 09:45:19 +08:00
parent cc40ecd35d
commit 5ea85aed4e
8 changed files with 93 additions and 264 deletions

View File

@ -1,59 +1,5 @@
<script lang="ts" setup>
import {onMounted} from "vue";
onMounted(() => {
// CSS
loadCSSFiles()
// JavaScript
loadJSFiles()
})
const loadJSFiles = () => {
const jsFiles = [
'/js/jquery-1.10.2.js',
'/js/bootstrap.min.js',
'/js/index.js',
'/js/gopcOm.js'
]
jsFiles.forEach(src => {
// JS
const existingScript = document.querySelector(`script[src="${src}"]`)
if (!existingScript) {
const script = document.createElement('script')
script.src = src
script.type = 'text/javascript'
document.head.appendChild(script)
}
})
}
const loadCSSFiles = () => {
const cssFiles = [
'/css/bootstrap.min.css',
'/css/main2.css',
'/css/yuxi2019.css',
'/css/Internet_Things.css',
]
cssFiles.forEach(href => {
// CSS
const existingLink = document.querySelector(`link[href="${href}"]`)
if (!existingLink) {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = href
link.type = 'text/css'
document.head.appendChild(link)
}
})
}
// 使 useHead
</script>
<template>

View File

@ -1,56 +1,5 @@
<script lang="ts" setup>
import {onMounted} from "vue";
onMounted(() => {
// CSS
loadCSSFiles()
// JavaScript
loadJSFiles()
})
const loadJSFiles = () => {
const jsFiles = [
'/js/jquery-1.10.2.js',
'/js/bootstrap.min.js',
'/js/gopcOm.js'
]
jsFiles.forEach(src => {
// JS
const existingScript = document.querySelector(`script[src="${src}"]`)
if (!existingScript) {
const script = document.createElement('script')
script.src = src
script.type = 'text/javascript'
document.head.appendChild(script)
}
})
}
const loadCSSFiles = () => {
const cssFiles = [
'/css/bootstrap.min.css',
'/css/main2.css',
// '/css/main.css',
'/css/Internet_Things.css',
'/css/yuxi2019.css'
]
cssFiles.forEach(href => {
// CSS
const existingLink = document.querySelector(`link[href="${href}"]`)
if (!existingLink) {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = href
link.type = 'text/css'
document.head.appendChild(link)
}
})
}
// 使 useHead
</script>
<template>

View File

@ -1,63 +1,27 @@
<script lang="ts" setup>
import {onMounted} from "vue";
import {useHead} from "#app";
definePageMeta({
layout: 'no-new'
})
onMounted(() => {
// CSS
loadCSSFiles()
// JavaScript
loadJSFiles()
// 使 Nuxt 3 useHead
useHead({
link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
{rel: 'stylesheet', href: '/css/main2.css'},
{rel: 'stylesheet', href: '/css/about.css'},
{rel: 'stylesheet', href: '/css/computer_public.css'},
{rel: 'stylesheet', href: '/css/headORfooter.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'},
{rel: 'stylesheet', href: '/css/Internet_Things.css'}
],
script: [
{src: '/js/index.js'},
{src: '/js/gopcOm.js'}
]
})
const loadJSFiles = () => {
const jsFiles = [
'/js/jquery.1.11.3.min.js',
'/js/bootstrap.min.js',
'/js/index.js',
'/js/gopcOm.js'
]
jsFiles.forEach(src => {
// JS
const existingScript = document.querySelector(`script[src="${src}"]`)
if (!existingScript) {
const script = document.createElement('script')
script.src = src
script.type = 'text/javascript'
document.head.appendChild(script)
}
})
}
const loadCSSFiles = () => {
const cssFiles = [
'/css/bootstrap.min.css',
'/css/main2.css',
'/css/about.css',
'/css/computer_public.css',
'/css/headORfooter.css',
'/css/yuxi2019.css',
'/css/Internet_Things.css',
]
cssFiles.forEach(href => {
// CSS
const existingLink = document.querySelector(`link[href="${href}"]`)
if (!existingLink) {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = href
link.type = 'text/css'
document.head.appendChild(link)
}
})
}
</script>
<template>

View File

@ -1,64 +1,27 @@
<script lang="ts" setup>
import {onMounted} from "vue";
import {useHead} from "#app";
definePageMeta({
layout: 'no-new'
})
onMounted(() => {
// CSS
loadCSSFiles()
// 使 Nuxt 3 useHead
useHead({
link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
{rel: 'stylesheet', href: '/css/main2.css'},
{rel: 'stylesheet', href: '/css/about.css'},
{rel: 'stylesheet', href: '/css/computer_public.css'},
{rel: 'stylesheet', href: '/css/headORfooter.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'},
{rel: 'stylesheet', href: '/css/Internet_Things.css'}
],
script: [
// JavaScript
loadJSFiles()
{src: '/js/index.js'},
{src: '/js/gopcOm.js'}
]
})
const loadJSFiles = () => {
const jsFiles = [
'/js/jquery.1.11.3.min.js',
'/js/bootstrap.min.js',
'/js/index.js',
'/js/gopcOm.js'
]
jsFiles.forEach(src => {
// JS
const existingScript = document.querySelector(`script[src="${src}"]`)
if (!existingScript) {
const script = document.createElement('script')
script.src = src
script.type = 'text/javascript'
document.head.appendChild(script)
}
})
}
const loadCSSFiles = () => {
const cssFiles = [
'/css/bootstrap.min.css',
'/css/main2.css',
'/css/about.css',
'/css/computer_public.css',
'/css/headORfooter.css',
'/css/yuxi2019.css',
'/css/Internet_Things.css',
]
cssFiles.forEach(href => {
// CSS
const existingLink = document.querySelector(`link[href="${href}"]`)
if (!existingLink) {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = href
link.type = 'text/css'
document.head.appendChild(link)
}
})
}
</script>
<template>

View File

@ -1,5 +1,23 @@
<script lang="ts" setup>
import {useHead} from "#app";
// 使 Nuxt 3 useHead
useHead({
link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
{rel: 'stylesheet', href: '/css/main2.css'},
{rel: 'stylesheet', href: '/css/about.css'},
{rel: 'stylesheet', href: '/css/computer_public.css'},
{rel: 'stylesheet', href: '/css/headORfooter.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'},
{rel: 'stylesheet', href: '/css/Internet_Things.css'}
],
script: [
{src: '/js/index.js'},
{src: '/js/gopcOm.js'}
]
})
</script>
<template>

View File

@ -1,5 +1,18 @@
<script lang="ts" setup>
import {useHead} from "#app";
// 使 Nuxt 3 useHead
useHead({
link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
{rel: 'stylesheet', href: '/css/main2.css'},
{rel: 'stylesheet', href: '/css/Internet_Things.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'}
],
script: [
{src: '/js/gopcOm.js'}
]
})
</script>
<template>

View File

@ -1,58 +1,19 @@
<script lang="ts" setup>
import {onMounted} from "vue";
import {useHead} from "#app";
onMounted(() => {
// CSS
loadCSSFiles()
// 使 Nuxt 3 useHead
useHead({
link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
{rel: 'stylesheet', href: '/css/main2.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'},
{rel: 'stylesheet', href: '/css/Internet_cabinet.css'}
],
script: [
// JavaScript
loadJSFiles()
{src: '/js/gopcOm.js'}
]
})
const loadJSFiles = () => {
const jsFiles = [
'/js/jquery-1.10.2.js',
'/js/bootstrap.min.js',
'/js/gopcOm.js'
]
jsFiles.forEach(src => {
// JS
const existingScript = document.querySelector(`script[src="${src}"]`)
if (!existingScript) {
const script = document.createElement('script')
script.src = src
script.type = 'text/javascript'
document.head.appendChild(script)
}
})
}
const loadCSSFiles = () => {
const cssFiles = [
'/css/bootstrap.min.css',
'/css/main2.css',
'/css/yuxi2019.css',
'/css/Internet_cabinet.css',
]
cssFiles.forEach(href => {
// CSS
const existingLink = document.querySelector(`link[href="${href}"]`)
if (!existingLink) {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = href
link.type = 'text/css'
document.head.appendChild(link)
}
})
}
</script>
<template>

View File

@ -1,4 +1,19 @@
<script lang="ts" setup>
import {useHead} from "#app";
// 使 Nuxt 3 useHead
useHead({
link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
{rel: 'stylesheet', href: '/css/main2.css'},
{rel: 'stylesheet', href: '/css/ebikes.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'}
],
script: [
{src: '/js/index.js'},
{src: '/js/gopcOm.js'}
]
})
</script>
<template>