1、index.html中引入百度地图

<script type="text/javascript" src="http://pv.sohu.com/cityjson?ie=utf-8"></script>

 

2、在webpack.base.conf.js里面 配置

module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
externals: {
"returnCitySN": "returnCitySN"
},
}

 

3、引入使用

import returnCitySN from 'returnCitySN' // 新浪 获取设备IP

let equipmentIp = returnCitySN.cip