1分钟部署网站📞AI智能客服,大模型训练自有数据,简单好用,有效降低客服成本 广告
[**点击体验新版网站**](https://www.chuxueyun.com/) [**点击体验新版网站**](https://www.chuxueyun.com/) [**点击体验新版网站**](https://www.chuxueyun.com/) [**点击体验新版网站**](https://www.chuxueyun.com/) [**点击体验新版网站**](https://www.chuxueyun.com/) [**点击体验新版网站**](https://www.chuxueyun.com/) [**点击体验新版网站**](https://www.chuxueyun.com/) 使用vue框架的用户会有接收不到回调的问题,下面是处理方法 ~~~ export default { data() { }, mounted(){ //methodName为自定义方法名 (这句代码是关键) window.callName= this.methodName; }, methods: { methodName(res){ //你的逻辑 alert(res); } } }; ~~~ 只需要将自定义接收回调的方法挂载在window上(mounted里面的代码)就可以接收到app端的回调了 ~~~ BSL.somefunction('callName'); ~~~ vue框架调用我们的js方法示例 ~~~ <template> <div> <p @click="getGps">获取位置信息</p> </div> </template> <script> export default { data() { return { } }, created(){ window.gps = this.gps; }, methods:{ getGps(){ BSL.GPS('gps'); }, gps(g){ alert(g); } } } </script> ~~~