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-dist-picker

v1.1.0

Published

vue组件:中国省市区三联选择(pc端)

Downloads

53

Readme

vue-dist-picker

vue组件:中国省市区三联选择(pc端)

更新日志

@1.0.0

  • 我出生了

demo

示例([email protected]+) 点我.

截图

screenshot screenshot screenshot

依赖

基于 [email protected]+ 版本,模块使用es6编写(需babel转译),css使用scss编译(需scss-loader转译)。

地区列表数据源

china-dist-data.

当然你可以使用自己的数据,格式与此相符即可,该组件最终需要的是一个名为“DIST_PICKER_LIST”的全局变量。

安装

npm

$ npm install vue-dist-picker china-dist-data

使用

参考示例,地区列表需要按指定的格式,并声明全局变量。

相关参数

| 名称 | 类型 | 默认 | 说明 | | ----------------- | ----------------- | ---------------- | --------------------------------------------- | | value | String | "" | 要双向绑定的地区Id | | field | String | "" | 会给input标签添加name及id属性 | | placeholder | String | "" | 你懂的 |

示例([email protected]+)


<div id="app">
	<label for="dist">收货地址</label>
	<dist-picker field="dist" placeholder="选择您的收货地址" :value.sync="distId"></dist-picker>
</div>

<script>
import 'babel-polyfill'; //因为使用了es6的一些方法,需要babel垫片,如果你项目中已有相关兼容性方案,可忽略
import distList from 'china-dist-data';
import Vue from 'vue';
import myDistPicker from 'vue-dist-picker';

//注册一个地区列表全局变量(考虑到distList会比较大,如项目中多次使用,单独为一个js文件比较好)
window.DIST_PICKER_LIST = distList;

new Vue({
	el: '#app',
	data: {
		distId: ''
	},
	components: {
		'dist-picker': myDistPicker
	}
});

</script>