vue中通过script的形式使用外部库

如:index.html中:




需要在webpack中配置externals 以供其他地方使用
build/webpack.base.conf.js中的module.exports的最后加入如下配置:

externals: {
    vue: "Vue",
    AMap: "window.AMap",
    AMapUI: "window.AMapUI"
  }

 

你可能感兴趣的:(VUE)