Socket
Socket
Sign inDemoInstall

@ubrorg/location-judge

Package Overview
Dependencies
Maintainers
11
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ubrorg/location-judge

位置判断


Version published
Weekly downloads
9
Maintainers
11
Weekly downloads
 
Created
Source

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)
}

开发

  1. yarn 或者 ayarn阿里内网)安装依赖
  2. 小程序 IDE 打开组件(下载地址

更多命令

  • miapp newbranch: 新建分支
  • miapp push: 提交代码
  • miapp prepub: 预发(发布 beta 版本)
  • miapp publish: 正式发布

FAQs

Package last updated on 19 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc