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-country-selector

v1.0.2

Published

A component base on Vue.js for selecting country.

Readme

vue-country-selector

介绍

vue-country-selector是基于Vue.js开发的一个国家选择器,可用来快速选择、搜索国家。它的样式参考了Element-ui中el-input的样式。

example1.png | center | 519x287

example2.png | center | 317x298

安装

#npm
npm install vue-country-selector --save

# yarn
yarn add vue-country-selector

快速开始

// main.js
import Vue from 'vue';
import CountrySelector from 'vue-country-selector';

// import stylesheet
import 'vue-country-selector/dist/countryselect.css';

// use in template tag
<template>
    <country-selector v-model="selected" width="260" ></country-selector>
</template>

参数列表

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | --- | --- | --- | --- | --- | | width | 定义组件的宽度 | String/Number | —— | 默认宽度为100% | | language | 定义组件的默认显示语言 | String | zh/en/auto | auto,即根据浏览器语言来显示 | | placeholder | 定义文本输入框的placeholder | String | —— | —— | | size | 组件的size | String | large/medium/small/mini | medium | | data | 组件的数据源 | Array | —— | 默认值及格式要求见下 | | value | v-model绑定的值 | String | —— | —— |

data数据源

vue-country-select组件将根据data数据源中的数据来渲染组件的可选项,你可以根据自己的业务要求,通过data选项灵活的配置数据,如果你没有传入data选项,则vue-country-selector组件将使用内部默认的数据源来渲染组件。

data数据源的格式:

[
    {
        code: 'CN',             // id
        cnName: '中国',         // 中文名
        cnSpell: 'zhongguo',    // 中文拼音(大小写均可)
        enName: 'China',        // 英文名
        hot: true               // 是否热门,值为true的国家将显示在HOTtab下
    },
    {
        code: 'us',
        cnName: '美国',
        cnSpell: 'meiguo',
        enName: 'United States of America',
        hot: false
    },
    ...
]