Welcome

首页 / 脚本样式 / Vue / 在VUE中获取当前用户的ip

首先

在index.html中引入JS文件


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

其次

在vue中文件中使用


this.ip = returnCitySN["cip"];