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 |
|
9 | English | [็ฎไฝไธญๆ][ch] | [ะ ัััะบะธะน][ru]
|
10 |
|
11 | ## ๐ Vue3.x
|
12 |
|
13 | This 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 |
|
37 | Document: <https://nightcatsama.github.io/vue-slider-component>
|
38 |
|
39 | Live 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>
|
58 | import VueSlider from 'vue-slider-component'
|
59 | import 'vue-slider-component/theme/antd.css'
|
60 |
|
61 | export 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>
|
85 | import { reactive, toRefs } from 'vue'
|
86 | import VueSlider from 'vue-slider-component'
|
87 | import 'vue-slider-component/theme/antd.css'
|
88 |
|
89 | export 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 |
|
102 | Detailed 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 |
|
106 | If 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
|