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

h5pa-vue

v0.2.5

Published

HTML5+ App for Vue.js

Downloads

99

Readme

h5pa-vue

HTML5+ App for Vue.js

加入了 babel-polyfill [支持的特性]

安装

npm install h5pa-vue

基本使用

import Vue from 'vue'
import plus from 'h5pa-vue'
Vue.use(plus)

组件选项

其方法中的this指向组件

- event 选项

Events模块管理客户端事件,包括系统事件,如扩展API加载完毕、程序前后台切换等。

  1. "plusready": 扩展 API 加载完成事件
  2. "pause": 运行环境从前台切换到后台事件
  3. "resume": 运行环境从后台切换到前台事件
  4. "netchange": 设备网络状态变化事件
  5. "newintent": 新意图事件
  6. "plusscrollbottom": 窗口滚动到底部事件
  7. "error": 页面加载错误事件
  8. "background": 应用切换到后台运行事件
  9. "foreground": 应用切换到前台运行事件
  10. "trimmemory": 应用需要清理内存事件
  11. "splashclosed": 应用启动界面已关闭事件

- listener 选项

用于监听自定义的事件广播

$api 对象

全局window中扩展$api对象,$api中有许多静态方法

$plus 对象

全局window中扩展$plus对象,$plus中有许多静态方法

示例

export default {
  name: 'app',
  // Events模块管理客户端事件,包括系统事件,如扩展API加载完毕、程序前后台切换等。
  // "plusready": 扩展API加载完成事件
  // "pause": 运行环境从前台切换到后台事件
  // "resume": 运行环境从后台切换到前台事件
  // "netchange": 设备网络状态变化事件
  // "newintent": 新意图事件
  // "plusscrollbottom": 窗口滚动到底部事件
  // "error": 页面加载错误事件
  // "background": 应用切换到后台运行事件
  // "foreground": 应用切换到前台运行事件
  // "trimmemory": 应用需要清理内存事件
  // "splashclosed": 应用启动界面已关闭事件
  event: {
    // plusready,设备加载完成
    plusready() {
      console.log('test组件 设备加载完成')
    }
  },
  // 自定义窗体监听选项
  listener: {
    // “customEvent”为事件名称
    customEvent(e) {
      // e.detail:事件传递的数据
      alert('test:' + JSON.stringify(e.detail))
    }
  },
  methods: {
    // 广播消息
    send: function() {
      this.plus.send('customEvent', { a: 1 }, { self: true })
    }
  }
}

自定义扩展

import Vue from 'vue'
import plus from 'h5pa-vue'
Vue.use(plus, {
  // 全局指定hbuild的错误页地址
  errorPage: '/error.html',
  // 是否需要模拟
  isSim: true
})

参考