0.1.4 • Published 4 years ago

vue-input-spinner v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Vue Input Spinner

Vue 2.x component for spinning inputs

NPM

License: MIT npm package downloads

Demo

https://vue-input-spinner.netlify.com/

npm.io

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

AttributeTypeDefaultDescription
:valueNumber0Value for binding
:minValueNumber0Minimum value
:maxValueNumber10**1000Maximum value (default infinite)
:stepNumber1Step between increase and decreases
:inputClassStringvis-default-inputwidth: 50px; height: 50px; text-align: center; font-size: 24px;
:buttonClassStringvis-default-buttonwidth: 50px; height: 50px;
:buttonLeftClassString""This will overwrite buttonClass
:buttonRightClassString""This will overwrite buttonClass
:buttonLeftTextString-Text in left button
:buttonRightTextString+Text in right button
:editableBooleantrueToggling this converts input into a label
:readonlyBooelanfalseReadonly input

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. 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