【发布时间】:2020-02-07 02:45:15
【问题描述】:
我有标准的 Vue 路由器 - 它与导航完美配合
<router-link to="/test">test</router-link>,
但是当我试图在浏览器中输入 ULR 时
http://127.0.0.1:8889/test - 它正在重新加载页面并给我 404 错误。
作为服务器部分,我使用 CFML (Lucee)。
Vue 代码 - routes.js
import Home from './components/home.vue'
import Test from './components/articleView.vue'
export const routes = [
{ path: '/', component: Home},
{ path: '/test', component: Test}
]
index.js
import { routes } from './routes'
Vue.use(VueRouter);
const router = new VueRouter({
mode:'history', routes
})
new Vue({
el: '#app',
router,
render: h => h(App)
})
你能告诉我在哪里挖吗?
【问题讨论】: