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-selectl

v1.0.5

Published

selector based on vue2

Downloads

38

Readme

vue-selectl

Demo

Demo

vue-selectl base on Vue 2

Install

npm install vue-selectl --save

How to use

Attributes

| parameter | explain | type | optional | default | | ------------ | ------------------ | ------ | ----------------- | ---------- | | customdatas | custom data | array | - | [] | | initcurlists | init data | array | - | [] | | limit | choose up to a few | number | - | 0 |

Events

| even name | explain | callback | | --------- | ------------------- | -------- | | checkitem | listen to selection | array | | updateinit | listen to change initcurlists | array

Methods

| method name | explain | optional | | --------- | ------------------- | -------- | | reset | do reset | array[id] |

  1. use script
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>test</title>
  <link  rel="stylesheet" href="./dist/styles.css" />
</head>
<body>
  <div id="app">
    <vue-selectl :customdatas="datas" @checkitem="checkItem" @updateinit="changeCurLists" :initcurlists="curLists" :limit="limit" ref="vueSelectl"></vue-selectl>
    <button @click="add">add</button>
    <button @click="reset">reset</button>
  </div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.min.js"></script>
<script src="./dist/vue-selectl.js"></script>
<script type="text/javascript">
  var app = new Vue({
      el: '#app',
      data () {
        return {
          curLists: [],
          limit: 5,
          datas: {
            name: '所有部门',
            checked: false,
            id: 1,
            parentId: null,
            nodeSelectNotAll: false,
            englishName: 'all',
            child: [
              {
                name: '行政部',
                checked: false,
                id: 2,
                parentId: 1,
                nodeSelectNotAll: false,
                englishName: 'Administration Department',
                child: [
                  {
                    name: '行政管理',
                    checked: false,
                    id: 3,
                    parentId: 2,
                    nodeSelectNotAll: false,
                    englishName: 'Administrative Management',
                    child: [
                      {
                        name: '风风',
                        checked: false,
                        id: 4,
                        parentId: 3,
                        nodeSelectNotAll: false,
                        englishName: 'Feng Feng'
                      },
                      {
                        name: '后勤管理',
                        checked: false,
                        id: 5,
                        parentId: 3,
                        nodeSelectNotAll: false,
                        englishName: 'Logistics Management',
                        child: [
                          {
                            name: '行政安全',
                            checked: false,
                            id: 16,
                            parentId: 5,
                            nodeSelectNotAll: false,
                            englishName: 'Administrative Security',
                            child: [
                              {
                                name: '卡拉',
                                checked: false,
                                id: 17,
                                parentId: 16,
                                nodeSelectNotAll: false,
                                englishName: 'Ka La'
                              },
                              {
                                name: '乒乓',
                                checked: false,
                                id: 18,
                                parentId: 16,
                                nodeSelectNotAll: false,
                                englishName: 'Ping Pang'
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  {
                    name: '企业文化',
                    checked: false,
                    id: 6,
                    parentId: 2,
                    nodeSelectNotAll: false,
                    englishName: 'Corporate Culture',
                    child: [
                      {
                        name: '企业活动',
                        checked: false,
                        id: 7,
                        parentId: 6,
                        nodeSelectNotAll: false,
                        englishName: 'Enterprise Activity',
                        child: [
                          {
                            name: '日常活动',
                            checked: false,
                            id: 19,
                            parentId: 7,
                            nodeSelectNotAll: false,
                            englishName: 'Daily Activities',
                            child: [
                              {
                                name: '小健',
                                checked: false,
                                id: 20,
                                parentId: 19,
                                nodeSelectNotAll: false,
                                englishName: 'Xiao Jian'
                              },
                              {
                                name: '小东',
                                checked: false,
                                id: 21,
                                parentId: 19,
                                nodeSelectNotAll: false,
                                englishName: 'Acron'
                              }
                            ]
                          }
                        ]
                      },
                      {
                        name: '企业宣传',
                        checked: false,
                        id: 8,
                        parentId: 6,
                        nodeSelectNotAll: false,
                        englishName: 'Enterprise Propaganda',
                        child: [
                          {
                            name: '宣传文案',
                            checked: false,
                            id: 22,
                            parentId: 8,
                            nodeSelectNotAll: false,
                            englishName: 'Propaganda copy',
                            child: [
                              {
                                name: '哈利',
                                checked: false,
                                id: 23,
                                parentId: 22,
                                nodeSelectNotAll: false,
                                englishName: 'Ha Li'
                              },
                              {
                                name: '米妮',
                                checked: false,
                                id: 24,
                                parentId: 22,
                                nodeSelectNotAll: false,
                                englishName: 'Minnie'
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                name: '财务部',
                checked: false,
                id: 9,
                parentId: 1,
                nodeSelectNotAll: false,
                englishName: 'Finance Department',
                child: [
                  {
                    name: '税务管理',
                    checked: false,
                    id: 10,
                    parentId: 9,
                    nodeSelectNotAll: false,
                    englishName: 'Tax Administration',
                    child: [
                      {
                        name: '张三',
                        checked: false,
                        id: 11,
                        parentId: 10,
                        nodeSelectNotAll: false,
                        englishName: 'Zhang San'
                      },
                      {
                        name: '李四',
                        checked: false,
                        id: 12,
                        parentId: 10,
                        nodeSelectNotAll: false,
                        englishName: 'Halen'
                      }
                    ]
                  },
                  {
                    name: '财务管理',
                    checked: false,
                    id: 13,
                    parentId: 9,
                    nodeSelectNotAll: false,
                    englishName: 'Financial Management',
                    child: [
                      {
                        name: '李李',
                        checked: false,
                        id: 14,
                        parentId: 13,
                        nodeSelectNotAll: false,
                        englishName: 'Aline Ly'
                      },
                      {
                        name: '赵六',
                        checked: false,
                        id: 15,
                        parentId: 13,
                        nodeSelectNotAll: false,
                        englishName: 'Zhao Liu'
                      }
                    ]
                  }
                ]
              }
            ]
          }
        }
      },
      mounted () {
        // this.curLists.push(436)
        this.curLists = [4, 17, 20, 24, 23, 11]
      },
      methods: {
        checkItem: function (datas) {
          console.log('checkItem', datas)
        },
        add () {
          this.curLists.push(13)
          // this.curLists = [20, 24]
        },
        reset () {
          this.$refs.vueSelectl.reset([4, 17])
        },
        changeCurLists (value) {
          console.log(value)
        }
      }
    });
</script>
</html>
  1. webpack
import VueSelectl from 'vue-selectl'
import 'vue-selectl/dist/styles.css'
Vue.use(VueSelectl)