修复shareSolution

This commit is contained in:
WindowBird 2025-10-16 08:58:10 +08:00
parent e0c20f1a46
commit 08315cc2ed
4 changed files with 64 additions and 194 deletions

View File

@ -1,55 +1,25 @@
<script lang="ts" setup> <script lang="ts" setup>
import {onMounted} from "vue"; import {onMounted} from "vue";
import {useHead} from "#app";
onMounted(() => { // 使 Nuxt 3 useHead
// CSS useHead({
loadCSSFiles() link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
// JavaScript {rel: 'stylesheet', href: '/css/main2.css'},
loadJSFiles() {rel: 'stylesheet', href: '/css/ebikes.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'}
],
script: [
{src: '/js/index.js'},
{src: '/js/gopcOm.js'}
]
}) })
const loadJSFiles = () => { onMounted(() => {
const jsFiles = [ //
'/js/jquery-1.10.2.js', // useHead
'/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> </script>
<template> <template>

View File

@ -1,59 +1,25 @@
<script lang="ts" setup> <script lang="ts" setup>
import {onMounted} from "vue"; import {onMounted} from "vue";
import {useHead} from "#app";
onMounted(() => { // 使 Nuxt 3 useHead
// CSS useHead({
loadCSSFiles() link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
// JavaScript {rel: 'stylesheet', href: '/css/main2.css'},
loadJSFiles() {rel: 'stylesheet', href: '/css/yuxi2019.css'},
{rel: 'stylesheet', href: '/css/new_index.css'}
],
script: [
{src: '/js/index.js'},
{src: '/js/gopcOm.js'}
]
}) })
const loadJSFiles = () => { onMounted(() => {
const jsFiles = [ //
'/js/jquery-1.10.2.js', // useHead
'/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> </script>
<template> <template>

View File

@ -1,53 +1,21 @@
<script lang="ts" setup> <script lang="ts" setup>
import {onMounted} from "vue"; import {onMounted} from "vue";
import {useHead} from "#app";
onMounted(() => { // 使 Nuxt 3 useHead
// CSS useHead({
loadCSSFiles() link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
// JavaScript {rel: 'stylesheet', href: '/css/main2.css'},
// loadJSFiles() {rel: 'stylesheet', href: '/css/main.css'},
{rel: 'stylesheet', href: '/css/yuxi2019.css'}
]
}) })
// const loadJSFiles = () => { onMounted(() => {
// const jsFiles = [ //
// // '/js/jquery.1.11.3.min.js', // useHead
// // '/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> </script>
<template> <template>

View File

@ -1,59 +1,25 @@
<script lang="ts" setup> <script lang="ts" setup>
import {onMounted} from "vue"; import {onMounted} from "vue";
import {useHead} from "#app";
onMounted(() => { // 使 Nuxt 3 useHead
// CSS useHead({
loadCSSFiles() link: [
{rel: 'stylesheet', href: '/css/bootstrap.min.css'},
// JavaScript {rel: 'stylesheet', href: '/css/main2.css'},
loadJSFiles() {rel: 'stylesheet', href: '/css/yuxi2019.css'},
{rel: 'stylesheet', href: '/css/new_index.css'}
],
script: [
{src: '/js/index.js'},
{src: '/js/gopcOm.js'}
]
}) })
const loadJSFiles = () => { onMounted(() => {
const jsFiles = [ //
'/js/jquery-1.10.2.js', // useHead
'/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> </script>
<template> <template>