色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

vue項目中頁面刷新時移除css樣式

錢多多2年前8瀏覽0評論

當我第一次去這個鏈接的時候,頁眉頁腳的樣式還可以-enter image description here

但是當我刷新或重新加載頁面時,樣式就消失了。如何解決這個問題?enter image description here

下面是我的router.js-

import { createWebHistory, createRouter } from "vue-router";
import Home from '../components/Home.vue';
import Organization from '../components/aboutus/Organization.vue';


const router = createRouter({
    history: createWebHistory(),
    base: process.env.BASE_URL,
    scrollBehavior() {
        return { x: 0, y: 0 }
    },
    routes: [
        {
            name:'Home',
            path:'/',
            component:Home
        },
        {
            name:'Organization',
            path:'/about_us/organization',
            component:Organization
        },
    ],
})
router.beforeEach((to, _, next) => {

    return next()
})
// ? For splash screen
// Remove afterEach hook if you are not using splash screen
router.afterEach(() => {
    // Remove initial loading
    /*const appLoading = document.getElementById('loading-bg')
    if (appLoading) {
        appLoading.style.display = 'none'
    }*/
})
export default router

下面是main.js-

import { createApp } from 'vue'
import App from './App.vue'
import router from './router/router'
import store from './store/index'

createApp(App).use(
    router,
    store,).mount('#app')

就我而言,我改變了

<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">

<link rel="stylesheet" href="/vendors/bootstrap/dist/css/bootstrap.min.css">

要獲得css和javascript文件準確地址, 而且很管用!

所有的css和javascript文件都在index.html導入