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-region-slider

v0.0.3

Published

有些项目涉及到价格选择,需要用到区间滑动,vue-region-slider基于vue开发

Downloads

16

Readme

简介

有些项目涉及到价格选择,需要用到区间滑动,vue-region-slider基于vue开发

###使用

// main.js
import sRegionSlider from 'vue-region-slider';
import sRegionSlider from 'vue-region-slider/vue-region-slider/vue-region-slider.css';
Vue.use(sRegionSlider)

// template.vue
<vue-region-slider :fillValue="1000" :minValue="300" :maxValue="700" :step="3" @up="up" @down="down" @move="move"/>

方法说明

属性
| 名 | 类型 | 说明 | 默认 | |--|--|--|--| | fillValue| number | 最大范围 | 1000 | | maxValue | number |滑块最大默认值 |1000 | | minValue |number |滑块最小默认值 | 0 | | step| number |滑动后显示的数值只能是step倍数,例如:金额只能是10的倍数的时候,step可以设置为10 | 50 | 事件
| 名 | 说明 | event | |--|--|--| | down| 触发touchstart方法 | 返回了原有的event信息, 并添加了custom对象 | | move | 触发touchmove方法 | 返回了原有的event信息, 并添加了custom对象 | | up| 触发touchend方法 | 返回了原有的event信息, 并添加了custom对象 |

e.custom 说明
| 名 | 说明 | event | |--|--|--| | type| 当前触发的事件中是哪个滑块 ,('min'/'max') | | minValue| 左边滑块的值 | | maxValue | 右边滑块的值 | | curValue | 互动过程中的值, 注:此项只有move方法中才会有值,down和up不存在curValue |

使用案例

<div style="margin-top:200rpx;padding:100rpx;">
	<vue-region-slider :minValue="300" :maxValue="700" :step="40" @up="up"  @down="down"  @move="move" />
</div>

	export default {
		components: {sRegionSlider},
		methods: {
			down(e){
				// e中包含了原有的e信息, 并添加了custom对象
				const type = e.custom.type;
				const minValue = e.custom.minValue;
				const maxValue = e.custom.maxValue ;			
			},
			up(e){
				// e中包含了原有的e信息, 并添加了custom对象
				const type = e.custom.type;
				const minValue = e.custom.minValue;
				const maxValue = e.custom.maxValue ;		
				const curValue  = e.custom.curValue  ;	
			},
			move(e){
				// e中包含了原有的e信息, 并添加了custom对象
				const type = e.custom.type;
				const minValue = e.custom.minValue;
				const maxValue = e.custom.maxValue ;		
			},
		}
	}

上面代码运行到各端的效果图

在这里插入图片描述