修复shareSolution
This commit is contained in:
parent
e0c20f1a46
commit
08315cc2ed
|
|
@ -1,55 +1,25 @@
|
|||
<script lang="ts" setup>
|
||||
import {onMounted} from "vue";
|
||||
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'}
|
||||
]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 加载CSS样式文件
|
||||
loadCSSFiles()
|
||||
|
||||
// 加载JavaScript文件
|
||||
loadJSFiles()
|
||||
// 页面挂载后的初始化逻辑可以在这里添加
|
||||
// 资源已经通过 useHead 预加载,无需动态加载
|
||||
})
|
||||
|
||||
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/ebikes.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,25 @@
|
|||
<script lang="ts" setup>
|
||||
import {onMounted} from "vue";
|
||||
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/yuxi2019.css'},
|
||||
{rel: 'stylesheet', href: '/css/new_index.css'}
|
||||
],
|
||||
script: [
|
||||
{src: '/js/index.js'},
|
||||
{src: '/js/gopcOm.js'}
|
||||
]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 加载CSS样式文件
|
||||
loadCSSFiles()
|
||||
|
||||
// 加载JavaScript文件
|
||||
loadJSFiles()
|
||||
// 页面挂载后的初始化逻辑可以在这里添加
|
||||
// 资源已经通过 useHead 预加载,无需动态加载
|
||||
})
|
||||
|
||||
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/new_index.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,53 +1,21 @@
|
|||
<script lang="ts" setup>
|
||||
import {onMounted} from "vue";
|
||||
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/main.css'},
|
||||
{rel: 'stylesheet', href: '/css/yuxi2019.css'}
|
||||
]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 加载CSS样式文件
|
||||
loadCSSFiles()
|
||||
|
||||
// 加载JavaScript文件
|
||||
// loadJSFiles()
|
||||
// 页面挂载后的初始化逻辑可以在这里添加
|
||||
// 资源已经通过 useHead 预加载,无需动态加载
|
||||
})
|
||||
|
||||
// const loadJSFiles = () => {
|
||||
// const jsFiles = [
|
||||
// // '/js/jquery.1.11.3.min.js',
|
||||
// // '/js/bootstrap.min.js',
|
||||
// ]
|
||||
//
|
||||
// jsFiles.forEach(src => {
|
||||
// // 检查是否已经加载过该JS文件
|
||||
//
|
||||
// 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/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,25 @@
|
|||
<script lang="ts" setup>
|
||||
import {onMounted} from "vue";
|
||||
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/yuxi2019.css'},
|
||||
{rel: 'stylesheet', href: '/css/new_index.css'}
|
||||
],
|
||||
script: [
|
||||
{src: '/js/index.js'},
|
||||
{src: '/js/gopcOm.js'}
|
||||
]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 加载CSS样式文件
|
||||
loadCSSFiles()
|
||||
|
||||
// 加载JavaScript文件
|
||||
loadJSFiles()
|
||||
// 页面挂载后的初始化逻辑可以在这里添加
|
||||
// 资源已经通过 useHead 预加载,无需动态加载
|
||||
})
|
||||
|
||||
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/new_index.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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user