软件应用开发闪屏修复
This commit is contained in:
parent
08315cc2ed
commit
18e3f0f987
|
|
@ -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/computer_public.css',
|
||||
'/css/headORfooter.css',
|
||||
'/css/mobile_App.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)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 组件不需要加载资源,由页面统一管理
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -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/computer_public.css',
|
||||
'/css/headORfooter.css',
|
||||
'/css/mobile_App.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)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 组件不需要加载资源,由页面统一管理
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,21 @@
|
|||
<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/computer_public.css'},
|
||||
{rel: 'stylesheet', href: '/css/headORfooter.css'},
|
||||
{rel: 'stylesheet', href: '/css/mobile_App.css'},
|
||||
{rel: 'stylesheet', href: '/css/yuxi2019.css'}
|
||||
],
|
||||
script: [
|
||||
{src: '/js/index.js'},
|
||||
{src: '/js/gopcOm.js'}
|
||||
]
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user