当我第一次去这个链接的页眉页脚样式是好的-x1c 0d1x
但是当我刷新或重新加载页面时,样式就消失了。怎么解决这个问题?
下面是My 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
下面是主要的.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')
1条答案
按热度按时间z4bn682m1#
在我的情况下,我改变了
至
有css和javascript文件的确切地址,它的工作!
所有css和javascript文件都导入index.html