在 vue.js 、vue-router 和 webpack 中加载静态 html 文件
load static html file in vue.js , vue-router and webpack
我正在使用 vue.js 和 webpack 为我的朋友开发主页。但是他想保留一些使用 javascript 和 jquery(cdn) 的旧页面。
我可以在 vue-router 中做一些配置来做这样的事情吗?
/home --> Vue Project Homepage
/photo ---> Vue router change the router-view to photo.vue
/download ---> Go to the directory "/download" in project and load the index.html in "/download" directory
你可以简单地使用 Vue 路由器的 Redirect and Alias:
"Redirecting is also done in the routes configuration. To redirect from /a to /b:"
const router = new VueRouter({
routes: [
{ path: '/a', redirect: '/b' }
]
})
我正在使用 vue.js 和 webpack 为我的朋友开发主页。但是他想保留一些使用 javascript 和 jquery(cdn) 的旧页面。 我可以在 vue-router 中做一些配置来做这样的事情吗?
/home --> Vue Project Homepage
/photo ---> Vue router change the router-view to photo.vue
/download ---> Go to the directory "/download" in project and load the index.html in "/download" directory
你可以简单地使用 Vue 路由器的 Redirect and Alias:
"Redirecting is also done in the routes configuration. To redirect from /a to /b:"
const router = new VueRouter({
routes: [
{ path: '/a', redirect: '/b' }
]
})