Jef*_*rai 4 javascript vue.js vue-router netlify vuetify.js
主页.vue
<template>
<h3>Home</h3>
</template>
Run Code Online (Sandbox Code Playgroud)
测试1.vue
<template>
<h3>TEst page {{symbol}}</h3>
</template>
<script>
export default {
data() {
return {
symbol: this.$route.params.id
}
},
}
</script>
Run Code Online (Sandbox Code Playgroud)
export default new Router({
mode: 'history',
routes: [
{
path: '/test/:id',
component: Test1
},
{
path: '/home',
component: Home
},
]
})
Run Code Online (Sandbox Code Playgroud)
我无法通过网站 [netlifylink/test/1] 调用。它是“页面未找到,您似乎访问了一个损坏的链接或输入了该站点上不存在的 URL”。
但是仍然可以访问 localhost:8080/test/1
我打电话给 localhost:8080/home 并且 [netlifylink/home] 工作正常。为什么?
请帮帮我。对不起语法。
它也在Vue文档部署部分
https://cli.vuejs.org/guide/deployment.html#netlify
为了history mode在 Vue Router 上接收直接命中,您需要创建一个名为_redirectsunder的文件/public,其内容如下:
# Netlify settings for single-page application
/* /index.html 200
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1071 次 |
| 最近记录: |