【问题标题】:load static html file in vue.js , vue-router and webpack在 vue.js 、 vue-router 和 webpack 中加载静态 html 文件
【发布时间】:2019-02-07 05:21:42
【问题描述】:

我正在使用 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

【问题讨论】:

    标签: javascript vue.js webpack vue-router


    【解决方案1】:

    你可以简单地使用Vue路由器的Redirect and Alias

    “重定向也在路由配置中完成。从/a重定向到/b:”

    const router = new VueRouter({
      routes: [
        { path: '/a', redirect: '/b' }
      ]
    })
    

    【讨论】:

      猜你喜欢
      • 2018-12-11
      • 2017-09-29
      • 2018-03-15
      • 1970-01-01
      • 2017-08-19
      • 2017-04-05
      • 1970-01-01
      • 2021-05-19
      • 2021-02-13
      相关资源
      最近更新 更多