vue-router源码浅显分析(一)--Vue.use(VueRouter), new VueRouter(options),HashHistory
1,vue中使用vueRouter需要通过vue.use(vueRouter),众所周知,这里实际上调用了VueRouter的install方法,对Vue进行了扩展,vueRouter的install方法如下:
function install (Vue) {
//如果已经挂载了,跳过
if (install.installed && _Vue === Vue) { ret...
原创
2019-02-21 09:42:00 ·
3238 阅读 ·
0 评论