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

@aurouscia/vue-china-area-select

v0.4.0

Published

vue3中国大陆地区省市区(2025)联动选择器

Readme

vue3中国大陆地区省市区(2025)联动选择器

行为

  • 选择一般的三级地区,将会出现三个select标签
  • 选择直辖市、省直辖县(无所属地级)、直筒子市(地级但无下辖县),将会出现两个select标签
  • 港澳台地区,只会出现一个select标签
  • 事件触发时返回的数组长度等于select标签的数量

引入

import ChinaAreaSelect from "@aurouscia/vue-china-area-select"

使用

<div class="my-selects">
    <ChinaAreaSelect
        :names-init="['湖北省','武汉市','江岸区']"
        :code-init="'000000'"
        @change="changeHandler"
    ></ChinaAreaSelect>
</div>

Props

  • :names-init 初始化选择的省市区名称
  • :code-init 初始化选择的省市区六位代码(优先级高于names-init
  • :emit-on-inited 初始化时是否emit一次?(默认为false

Emits

  • @change 选择器值改变时触发的事件
    • 返回值为当前选中的省市区名称数组names(长度可能为1、2、3)和六位代码code,以及当前状态是否正确即valid布尔值(有可选项时必须选择一个)
    • 初始化时默认不会触发,但使用expose重新初始化时若改变了当前值则会触发

Expose

  • initByProps()使用组件当前的props重新初始化选择器(覆盖当前的值)
  • getEmitData()获取当前数据,和@change获取的一样

自定义样式

本组件不提供任何样式,需自定义样式请在外面套上容器,并编写非scopedstyle标签,例如:

.my-selects select{
    font-size: 18px;
    height: 26px;
}
.my-selects select.cas_not_selected{
    border: 2px solid red;
}

其中cas_not_selected为未选择选项的select的类名,需重点强调,提示用户选择该项

自定义布局

本组件内是1-3个select标签,没有用容器包起来。需自定义布局请在外面套上容器,并指定容器的布局,例如:

.my-selects{
    display: flex;
    justify-content: space-between;
}

由于select标签的数量和长度不确定,建议使用flex布局,并设置flex-wrap: wrap

数据来源

@aurouscia/china-areas
该包也是我负责维护,如果行政区划有变动,请在gitee上提issue,我会及时更新

许可证

MIT