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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-picker-oym

v1.0.0

Published

+ 支持多联级选择,例如s国省市区、分类选择。

Readme

#移动端picker组件。

  • 支持多联级选择,例如s国省市区、分类选择。

##demo

<template>
  <picker
    ref="picker"
    v-if="countryList.length"
    :columns="columnsData"
    :items="pickerData"
    :readonly="disabled"
    v-model="intData"
    @input="inputChange"
    @change="selectChange"></picker>
</template>

<script>
  import picker from '../components/ColumnPicker/index.vue'

  export default {
    name: 'placePicker',
    components: {
      picker
    },
    data () {
      // intData的country === 存在于pickerData的country数组的value
      return {
        pickerData: {
          country:[],
          province: [],
          city: []
        },
        intData: {
          country: '', // country_中国
          province: '',
          city: ''
        }
      }
    },
    props: {
      disabled: Boolean
    },
    watch: {
      intData (v) {
        console.log('intdata', v)
        this.$root.placeSelected = v
      }
    },
    computed: {
      columnsData () {
        return this.$root.columnsData
      },
      countryList () {
        return this.$root.countryList
      },
      placeSelected () {
        return this.$root.placeSelected
      },
      sku () {
        return this.$root.sku
      }
    },
    methods: {
      inputChange (v) {
        this.intData = Object.assign(this.intData, v)
      },
      selectChange(v) {
        const name = v.value && v.value.split('_')[1]
        if(v.column == 'country') {
          this.$root.getPlace(1, name).then(data => {
            this.pickerData.province = data || []
            this.$refs.picker.updateColumn('province', `province_${this.placeSelected.province}`)
            if (!data.length) {
              this.pickerData.city = []
            }
          })
        } else if(v.column == 'province') {
          this.$root.getPlace(2, name).then(data => {
            this.pickerData.city = data || []
            this.$refs.picker.updateColumn('city', `city_${this.placeSelected.city}`)
          })
        }
      }
    },
    mounted () {
      this.$root.$on('place.update', (data) => {
        this.pickerData.country = data
        this.intData.country = this.sku.production_addr1 ? `country_${this.sku.production_addr1}` : ''

        if (this.sku.production_addr1) {
          this.$nextTick(() => {
            this.$refs.picker.select.setValue({
              country: this.intData.country,
              province: `province_${this.sku.production_addr2}`,
              city: `city_${this.sku.production_addr3}`
            })
          })
        }
      })
    }
  }

</script>

Select 属性介绍 props

| 参数 | 说明 | 类型 | 可选值 | 默认值 | |---------------|-------------|-----------|--------------|-----------| | columns | 列 | Array | | | | items | 数据 | Object | | | | v-model | 初始值 | Object | | |

Select 事件介绍 event

| 名称 | 说明 | 参数 | |---------------|-------------|-----------| | change | 选择项改变 | {column: '', value: ''} | | input | 选择填入的内容改变 | {colomnKey: '', value: ''} |

Select 方法介绍 api

| 名称 | 说明 | 参数 | |---------------|-------------|-----------| | updateColumn | 更新列 | String 列名 | | setValue | 设置选中内容 | Object {key1: value1, key2: value2} |