Vue-Router重定向始终为/#/

时间:2017-05-24 18:09:05

标签: vuejs2 vue-router

我尝试将webpackapache模板集成到现有的后端自制框架中。网络服务器是vue-js

我希望在网址example.com/vue时加载并装入vue-component应用程序。

当我转到此网址时,我可以看到基本示例example.com/#/,但在我被重定向到import Vue from 'vue' import Router from 'vue-router' import Hello from '@/components/Hello' Vue.use(Router) export default new Router({ mode : 'history', routes: [ { path: '/', name: 'Hello', component: Hello } ] })

后一秒钟

您是否知道如何解决此问题以及问题出在哪里?

Router.js

// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})

Main.js

with curse as (select luna,an,valoare from cursl where moneda='eur')

    SELECT *

    FROM curse MATCH_RECOGNIZE (

        ORDER BY an,luna
        MEASURES strt.an as start_an, strt.luna as start_luna,
              strt.valoare as euro_inc,LAST(scade.valoare) as euro_sf,
              count(*) as nr_luni,
              strt.valoare-LAST(scade.valoare) as dif
        ONE ROW PER MATCH
        PATTERN (strt scade{3,})
        DEFINE
            scade AS scade.valoare < PREV(scade.valoare)
        ) a
    ORDER BY a.start_an,a.start_luna;

1 个答案:

答案 0 :(得分:1)

我必须在path: '/vue'文件中将我的路径定义为以下router.js。如果vue-router找不到路线,则会重定向到index.php