proxyTable:{ '/api':{ target:'', //此處爲你的API接口地址 changeOrigin:true, pathRewrite:{ '^/api':'' //這裏理解爲用api代替target中的地址 } } }
proxyTable:{ '/api':{ target:'', //此處爲你的API接口地址 changeOrigin:true, pathRewrite:{ '^/api':'' //這裏理解爲用api代替target中的地址 }, secure:false } }
router.js
let router=new VueRouter({
mode:'history',
routes:[
{
path:'/',
component:LoginPage,
beforeRouteEnter:(to,from,next)=>{
...//這樣發現不會觸發,需在相應的組件里加鉤子函數
}
}
]
})
export default(){ beforeRouteEnter:(to,from,next)=>{ ...//在這裏加 } }
其實在vue-router的官方文檔中寫的很清楚,本身沒有注意。javascript
let webpack = require('webpack') 在module.exports中加入插件相關配置 plugins: [ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "windows.jQuery": "jquery" }) ]
import 'bootstrap/dist/css/bootstrap.min.css' import 'bootstrap/dist/js/bootstrap.min.js'