UNPKG

2.6 kBMarkdownView Raw
1![banner](https://raw.githubusercontent.com/NightCatSama/vue-slider-component/master/.github/banner.jpg)
2
3[![downloads](https://img.shields.io/npm/dm/vue-slider-component.svg)][npm]
4[![npm-version](https://img.shields.io/npm/v/vue-slider-component.svg)][npm]
5[![license](https://img.shields.io/npm/l/express.svg)]()
6
7> ๐ŸŽš A highly customized slider component
8
9English | [็ฎ€ไฝ“ไธญๆ–‡][ch] | [ะ ัƒััะบะธะน][ru]
10
11## ๐Ÿ‰ Vue3.x
12
13This is still in beta and may contain unexpected bugs, please use with caution.
14
15#### install
16
17```bash
18$ yarn add vue-slider-component@next
19# npm install vue-slider-component@next --save
20```
21
22#### Breaking Changes
23
24- `value` -> `modelValue`. ([Official API Changes](https://v3-migration.vuejs.org/breaking-changes/v-model.html#v-model))
25
26## โœจ Features
27
28- ๐Ÿ– More customizable
29- ๐Ÿ‘— Multiple style themes
30- ๐Ÿณ Support for more sliders
31- ๐Ÿ“Œ Add marks
32- ๐ŸŽ‰ Support SSR
33- ๐Ÿ’ Support Typescript
34
35## ๐Ÿ“š Documentation
36
37Document: <https://nightcatsama.github.io/vue-slider-component>
38
39Live Demo: <https://jsfiddle.net/NightCatSama/2xy72dod/10547/>
40
41## ๐ŸŽฏ install
42
43```bash
44$ yarn add vue-slider-component
45# npm install vue-slider-component --save
46```
47
48## ๐Ÿš€ Usage
49
50<details><summary>Vue 2</summary>
51
52```vue
53<template>
54 <vue-slider v-model="value" />
55</template>
56
57<script>
58import VueSlider from 'vue-slider-component'
59import 'vue-slider-component/theme/antd.css'
60
61export default {
62 components: {
63 VueSlider,
64 },
65
66 data() {
67 return {
68 value: 0,
69 }
70 },
71}
72</script>
73```
74
75</details>
76
77<details><summary>Vue 3</summary>
78
79```vue
80<template>
81 <vue-slider v-model="value" />
82</template>
83
84<script setup>
85import { reactive, toRefs } from 'vue'
86import VueSlider from 'vue-slider-component'
87import 'vue-slider-component/theme/antd.css'
88
89export default {
90 setup() {
91 const data = reactive({ value: 0 })
92 return toRefs(data)
93 },
94}
95</script>
96```
97
98</details>
99
100## Changelog
101
102Detailed changes for each release are documented in the [release notes](https://github.com/NightCatSama/vue-slider-component/blob/master/CHANGELOG.md).
103
104## Support
105
106If my code has helped you, please consider [buy me a coffee](https://www.buymeacoffee.com/nightcat) โ˜•.
107
108## License
109
110[MIT](https://github.com/NightCatSama/vue-slider-component/blob/master/LICENSE)
111
112[npm]: https://www.npmjs.com/package/vue-slider-component
113[en]: https://github.com/NightCatSama/vue-slider-component/blob/master/README.md
114[ch]: https://github.com/NightCatSama/vue-slider-component/blob/master/README-CN.md
115[ru]: https://github.com/NightCatSama/vue-slider-component/blob/master/README-RU.md