npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-visitor

v0.0.4

Published

a vue plugin of detecting vistor, for example, browser, device and so on

Downloads

11

Readme

vue-visitor

vue-visitor是什么

vue-visitor是一个Vue插件,封装了用户的一些信息,例如设备,浏览器等

使用方法

umd包方式

一般引入min版本,即引入vue-visitor-版本号.min.js文件

  <script src="https://unpkg.com/vue/dist/vue.js"></script>
  <script type="text/javascript" src="../dist/vueVisitor-0.0.1.min.js"></script>
  <script>
    // 使用,例如
    // alert(Vue.device.os)
    // alert(Vue.browser.isWechat)
    // 或者 this.$device.os,  this.$browser.isWechat
  </script>

webpack 方式使用

第一步,安装

  npm install vue-visitor --save

第二步,引入包,并导入包

  import vueVisitor from 'vue-visitor'
  Vue.use(vueVisitor)

第三步,使用。 类似umd格式

    // 使用,例如
    // alert(Vue.device.os)
    // alert(Vue.browser.isWechat)
    // 或者 this.$device.os
    // this.$browser.isWechat

demo

  • 您可以查看demo目录文件
  • 或者查看在线demo

属性说明

如果没有特别说明,则属性example使用方式为 Vue.example,组件中则为this.$examle

  • ua

用户浏览器 user agent 信息,使用方式为组件内this.$ua或者 Vue.us

  • browser

浏览器环境,例如浏览器版本号,是否软件内置浏览器,还在不断实现中

子属性说明

  • isAlipay

    • 类型: Boolean
    • 含义: 是否支付宝内置浏览器
    • 备注: this.$browser.isAlipay或者Vue.browser.isAlipay
  • isBrowser

    • 类型: Boolean
    • 含义: 是否浏览器环境
    • 备注: 无
  • isMobile

    • 类型: Boolean
    • 含义: 是否移动设备
    • 备注: 无
  • isQQ

    • 类型: Boolean
    • 含义: 是否qq内置浏览器
    • 备注: 无
  • isWechat

    • 类型: Boolean
    • 含义: 是否微信内置浏览器
    • 备注: 无
  • isWeibo

    • 类型: Boolean
    • 含义: 是否微博客户端内置浏览器
    • 备注: 无
  • device属性

设备属性,比如是android还是ios

子属性说明

  • os
    • 类型: String
    • 含义: 操作系统
    • 备注: 返回, 'ios', 'android' 或者 'other'
  • isAndroid
    • 类型: Boolean
    • 含义: 是否安卓系统
    • 备注: 无
  • isIos
    • 类型: Boolean
    • 含义: 是否Ios系统
    • 备注: 无
  • isIpad
    • 类型: Boolean
    • 含义: 是否IPad
    • 备注: 无
  • isIpod
    • 类型: Boolean
    • 含义: 是否Ipod
    • 备注: 无
  • isIphone
    • 类型: Boolean
    • 含义: 是否Iphone
    • 备注: 无

改进与完善

本插件只是初步实现,还很不完善 欢迎做出您的贡献

  • 您可以提出issue,我会尽量快速回应,包括bug和建议
  • 您也可以PR,非常欢迎,但尽量但并不保证merge
  • 欢迎加qq群讨论:617600089