今天学习vuejs,里面用到了es6的写法,遇到了一个很怪的问题,不知道有人遇到么。

安装的模块引用:import Vue from 'vue';(注意,Vue处没有{},如果加上这个就报错Uncaught TypeError: _vue.Vue is not a function)

自己写的模块,route-config.js:

export function routeConfig() {
  console.log(3);
}

引用自己写的模块:import { routeConfig } from './lib/route-config';(注意,routeConfig处有{},如果没有就会报错Uncaught TypeError: (0 , _routeConfig2.default) is not a function)

不知道怎么解释这种现象,现做笔记记录一下。

05-28 14:37