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-action-pannel

v0.1.1

Published

vue, action-sheet, pannel

Downloads

14

Readme

Vue ActionPannel

❤❤❤❤ a beautiful Action Pannel ❤❤❤❤

demo1.gif

live demo

What's this

基于 vue-create-api 的活动面板 用于展示不同的操作接口

Installation and use

$ yarn add vue-action-pannel
or
$ npm install vue-action-pannel --save
import App from './App.vue'
import ActionPannel from 'vue-action-pannel'
import Vue from 'vue'

Vue.use(ActionPannel)

new Vue({
  render: h => h(App)
}).$mount('#app')
data () {
  return {
    // 初始化以下格式的list
    actions: [{
      icon: 'icon-article', // 引入iconfont的类名作为展示的icon
      text: '分享' // 引入文字作为标题
    }, {
      icon: 'icon-xiazai46',
      text: '客服'
    }, {
      icon: 'icon-yidong',
      text: '移动'
    }]
  }
}

methods: {
  // 得益于vue-create-api
  // 我们可以以函数的形式创建一个action-pannel
  openPannel: function () {
    let actionPannel = this.$createActionPannel({ // 函数式调用 将返回一个Vue实例
      $props: {
        actions: this.actions // 传入列表项
      }
    }).$on('select', (e) => { // 暴露select事件
      window.alert(`click: ${e.idx}, params: ${JSON.stringify(e.item)}`) // 参数包含下标以及传入的菜单项
      actionPannel.closePannel() // 完成操作后一定要使用closePannel函数来关闭这个面板哦
    })
  },
}

props

| name | type | desc |
| --------| ----- |------ | | actions | action | 活动列表 由一个个活动项数组组成 即[action, action, action] action对象结构为{icon: 'xxx', text: 'xxx'} |

methods

| name | desc | | ---- | ---- | |closePannel | 关闭该pannel 必须在select事件后执行 将会关闭pannel以及展示相应的效果 |

event

| name | params | desc | | ------ | ------ | ------ | | select| Object | 点击每个活动项后会触发一个select事件 select事件将会回调一个包含下标和选中的活动项对象(包含该活动项的icon以及标题) |

let actionPannel = this.$createActionPannel({ // 函数式调用 将返回一个Vue实例
  $props: {
    actions: this.actions // 传入列表项
  }
})
actionPannel.$on('select', (e) => { // 暴露select事件
  console.log(e) // { idx: 0, item: { icon: 'icon-xiazai46', text: '客服' } }
  actionPannel.closePannel() // 完成操作后一定要使用closePannel函数来关闭这个面板哦
})