bike修复图bug
This commit is contained in:
parent
a1de4e2436
commit
7e52a4dedf
|
|
@ -1,62 +1,32 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {onMounted} from "vue";
|
import {onMounted} from "vue";
|
||||||
|
import {useHead} from "#app";
|
||||||
|
|
||||||
|
// 使用 Nuxt 3 的 useHead 来管理头部资源
|
||||||
|
useHead({
|
||||||
|
link: [
|
||||||
|
{rel: 'stylesheet', href: '/cssBike/bootstrap.min.css'},
|
||||||
|
{rel: 'stylesheet', href: '/cssBike/main2.css'},
|
||||||
|
{rel: 'stylesheet', href: '/cssBike/index.css'},
|
||||||
|
{rel: 'stylesheet', href: '/cssBike/public.css'}
|
||||||
|
],
|
||||||
|
script: [
|
||||||
|
{src: '/jsBike/jquery.min.js'},
|
||||||
|
{src: '/jsBike/minBanner.js'},
|
||||||
|
{src: '/jsBike/news.js'}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 加载CSS样式文件
|
// 延迟加载以确保DOM完全渲染
|
||||||
loadCSSFiles()
|
|
||||||
|
|
||||||
// 加载JavaScript文件
|
|
||||||
loadJSFiles()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const loadJSFiles = () => {
|
|
||||||
const jsFiles = [
|
|
||||||
'/jsBike/jquery.min.js',
|
|
||||||
'/jsBike/minBanner.js',
|
|
||||||
'/jsBike/news.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 = [
|
|
||||||
'/cssBike/bootstrap.min.css',
|
|
||||||
'/cssBike/main2.css',
|
|
||||||
|
|
||||||
|
|
||||||
'/cssBike/index.css',
|
|
||||||
'/cssBike/public.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>
|
||||||
|
<div>
|
||||||
<view>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 首页巨幕 -->
|
<!-- 首页巨幕 -->
|
||||||
|
|
@ -280,7 +250,7 @@ const loadCSSFiles = () => {
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
||||||
BIN
public/images/minBanner-1.png
Normal file
BIN
public/images/minBanner-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 490 KiB |
BIN
public/images/minBanner-2.jpg
Normal file
BIN
public/images/minBanner-2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
BIN
public/images/minBanner-3.jpg
Normal file
BIN
public/images/minBanner-3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 400 KiB |
BIN
public/images/minBanner-4.jpg
Normal file
BIN
public/images/minBanner-4.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
|
|
@ -1,5 +1,9 @@
|
||||||
var p = $('#picplayer');
|
var p = $('#picplayer');
|
||||||
var pics1 = [{url:'images/minBanner-1.png',link:'#',time:3000},{url:'images/minBanner-2.jpg',link:'',time:3000},{url:'images/minBanner-3.jpg',link:'',time:3000},{url:'images/minBanner-4.jpg',link:'',time:3000}];
|
var pics1 = [{url: '/images/minBanner-1.png', link: '#', time: 3000}, {
|
||||||
|
url: '/images/minBanner-2.jpg',
|
||||||
|
link: '',
|
||||||
|
time: 3000
|
||||||
|
}, {url: '/images/minBanner-3.jpg', link: '', time: 3000}, {url: '/images/minBanner-4.jpg', link: '', time: 3000}];
|
||||||
initPicPlayer(pics1, p.css('width').split('px')[0], p.css('height').split('px')[0]);
|
initPicPlayer(pics1, p.css('width').split('px')[0], p.css('height').split('px')[0]);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user