该函数可以获取当前的地理位置、速度。同时封装了对位置获取失败的处理
object
export default{ data() { return { } }, onLoad() { uni.$u.getLocation().then((res)=>{ console.log(res) }) } } ✅ Copy success!copy
export default{ data() { return { } }, onLoad() { uni.$u.getLocation().then((res)=>{ console.log(res) }) } }
← Http 请求 节流防抖 →