0.1.4 • Published 4 years ago
vue-input-spinner v0.1.4
Vue Input Spinner
Vue 2.x component for spinning inputs
Demo
https://vue-input-spinner.netlify.com/
Installation
# Yarn
yarn add vue-input-spinner
# NPM
npm i vue-input-spinner
How to use
Import at individual .vue files
import VueInputSpinner from 'vue-input-spinner'
export default {
components: {
VueInputSpinner
},
// ...
};
Or register as a global component
import Vue from 'vue'
import VueInputSpinner from 'vue-input-spinner'
Vue.use(VueInputSpinner)
/* Or you can set options */
Vue.use(VueInputSpinner, {
buttonClass: 'fancy-class',
minValue: 10,
editable: false,
// ...
})
Template
<vue-input-spinner v-model="myData"></vue-input-spinner>
or use with props
<vue-input-spinner
v-model="myData"
minValue="1"
maxValue="10"
step="0.5"
inputClass="fancy-input"
buttonClass="fancy-button"
buttonLeftClass="this-class-will-overwrite"
buttonRightClass="this-one-as-well"
buttonLeftText="Minus (-)"
buttonRightText="Plus (+)"
:editable="false"
:readonly="false"
>
</vue-input-spinner>
Available Props
Attribute | Type | Default | Description |
---|---|---|---|
:value | Number | 0 | Value for binding |
:minValue | Number | 0 | Minimum value |
:maxValue | Number | 10**1000 | Maximum value (default infinite) |
:step | Number | 1 | Step between increase and decreases |
:inputClass | String | vis-default-input | width: 50px; height: 50px; text-align: center; font-size: 24px; |
:buttonClass | String | vis-default-button | width: 50px; height: 50px; |
:buttonLeftClass | String | "" | This will overwrite buttonClass |
:buttonRightClass | String | "" | This will overwrite buttonClass |
:buttonLeftText | String | - | Text in left button |
:buttonRightText | String | + | Text in right button |
:editable | Boolean | true | Toggling this converts input into a label |
:readonly | Booelan | false | Readonly input |
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Contributors
Kaan Gökdemir - Author (@kaangokdemir) - kaangokdemir.com
License
MIT
0.1.4
4 years ago
0.1.3
4 years ago
0.1.0
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.0.15
4 years ago
0.0.14
4 years ago
0.0.13
4 years ago
0.0.11
4 years ago
0.0.12
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago