vue-slider-component
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "vue-slider-component", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Can use the Slider component in vue1.x and vue2.x", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
}, | ||
"author": "NightCatSama", | ||
"author": "NightCatSama <642163903@qq.com>", | ||
"license": "ISC", | ||
@@ -15,0 +15,0 @@ "bugs": { |
@@ -8,3 +8,3 @@ # vue-slider-component | ||
``` | ||
npm install vue-slider-component | ||
npm install vue-slider-component | ||
``` | ||
@@ -20,4 +20,20 @@ | ||
- [x] The custom data | ||
- [ ] Range | ||
- [x] Range | ||
## Example | ||
``` | ||
cd vue-slider-component/example | ||
``` | ||
``` | ||
npm install | ||
``` | ||
``` | ||
npm run dev | ||
``` | ||
``` | ||
npm run build | ||
``` | ||
## usage | ||
@@ -27,3 +43,3 @@ Use in vue1.x | ||
e.g: | ||
``` | ||
```html | ||
<template> | ||
@@ -58,6 +74,6 @@ <div> | ||
Use in vue2.x | ||
<br>Because```.sync``` are deprecated. Props are now always one-way down. So in order to realize the two-way, Can be set in the @callback | ||
<br>Because```.sync``` was deprecated. Props are now always one-way down. So in order to realize the two-way, Can be set in the @callback | ||
e.g: | ||
``` | ||
```html | ||
<template> | ||
@@ -110,3 +126,3 @@ <div> | ||
| tooltip | String,Boolean| false | control the tooltip ['hover', 'always', false] | | ||
| val | Number | 0 | initial value | | ||
| val | Number,Array | 0 | initial value (if the value for the array open range model) | | ||
| data | Array | null | the custom data | | ||
@@ -116,13 +132,17 @@ | ||
### Function | ||
| Name | Params&Type | Description | | ||
| ----------- |:--------------| ---------|--------------| | ||
| setValue | value[Number] | set value of the component | | ||
| setIndex | index[Number] | set index of the component (Particularly useful in [used piecewise] or [the custom data]) | | ||
| refresh | null | Refresh the component | | ||
| Name | Type | Description | | ||
| ----------- |:-----------------------------| -------------| | ||
| setValue | Params: value[Number, Array] | set value of the component | | ||
| setIndex | Params: index*[Number] | set index of the component | | ||
| getValue | Return: value[Number, Array] | get value of the component | | ||
| getIndex | Return: index*[Number] | get index of the component | | ||
| refresh | null | Refresh the component | | ||
* [ index ] is the index to the array in the custom data model * | ||
* [ index ] is equal to (( value - min ) / interval ) in normal mode * | ||
### Events | ||
| Name | Params&Type | Description | | ||
| Name | Type | Description | | ||
| ----------- |:--------------|--------------| | ||
| callback | value[Number] | values change when the callback function | | ||
| callback | Params:value[Number] | values change when the callback function | | ||
@@ -132,3 +152,3 @@ ### Slot | ||
default: | ||
``` | ||
```html | ||
<slot name="left">{{ min }}</slot> | ||
@@ -139,3 +159,3 @@ <slot name="right">{{ max }}</slot> | ||
custom: | ||
``` | ||
```html | ||
<template> | ||
@@ -142,0 +162,0 @@ <vue-slider ref="slider" :min="minimum" :max="maximum" :val="val" @callback="getValue"> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
168611
165
318