1.2.0 • Published 5 years ago
@ubrorg/location-judge v1.2.0
location-judge
位置判断
使用
静默获取用户当前位置调用getLocation() 页面导航按钮点击时调用judgeLocation()
import { judgeLocation, getLocation } from "@ubrorg/location-judge";
// 页面导航点击事件
async handelNavigation() {
// 在当前页面编译模式入参 flag: true 可跳过位置校验,方便测试;默认为false,可不传
const isInThePark = await judgeLocation({ flag: false })
console.log(isInThePark)
}
// 静默获取当前位置
async handleGetLocation() {
const myLocation = await getLocation()
console.log(myLocation)
}开发
更多命令
miapp newbranch: 新建分支miapp push: 提交代码miapp prepub: 预发(发布 beta 版本)miapp publish: 正式发布