Laravel + Vuejs,重新加载子级路由器路径时缺少样式

时间:2018-06-27 07:19:22

标签: laravel vue.js vue-router

当我使用链接(href)导航时,http://localhost:8080/user/profile页面可以工作,但是如果刷新页面(Ctrl + F5),它会显示内容,但是样式丢失。有想法吗?

routes.js

{
    path: '/user',
    name: 'Dashboard',
    component: require('./components/pages/Dashboard'),
    meta: {
      requiresAuth: false
    },
    props: { bcName: "Dashboard" },
    children: [
        {
            path: 'profile',
            name: 'Profile',
            components: {
                mainarea: require('./components/pages/Profile'),
            }
        }

    ]
}

Usermain.vue

<template>
<!-- Content Column -->
<div class="col-lg-9 mb-4">
<router-view name="mainarea"> </router-view>
</div>
</template>

Dashboard.vue

<template>
    <!-- Content Row -->
    <div class="row">
        <user-sidebar></user-sidebar>
        <user-main></user-main>
    </div>
</template>

Profile.vue

<template>
    <div class="test">Profile page {{layout}}</div>
</template>

0 个答案:

没有答案