3.7.0 • Published 6 years ago

@livelybone/vue-input v3.7.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

@livelybone/vue-input

gzip with dependencies: 1.5kb pkg.module mobile supported ssr supported

pkg.module supported, which means that you can apply tree-shaking in you project

A vue input component, a wrapper of input validator, formatter. textarea available

Fixed bug of chinese input

Fixed unexpected action of auto-fill in chrome and firefox by setting set autocomplete to 'off' to disabled auto-fill

repository

https://github.com/livelybone/vue-input.git

Demo

https://livelybone.github.io/vue/vue-input/

Installation

npm i -S @livelybone/vue-input

Register

import VueInput from '@livelybone/vue-input';

// Global register
Vue.component('vue-input', VueInput);

// Local register
new Vue({
  components:{VueInput}
})

Init

You can init a instance by call its init method, then the valid and pristine will be reset, see: https://github.com/livelybone/vue-input/blob/master/src/components/Index.vue#L95-L97

Props

NameTypeDefaultValueDescription
id[String, Number]none
value[String, Number]none
configStringdefaultConf
// defaultValue of config
const defaultConf = {
  // Options: [textarea, text, password, ...]
  inputType: 'text', 
  placeholder: '',
  validator: () => true,
  // ['pre','suf'], timing of validator
  validateType: 'pre',
  // Formatting when inputting
  preFormatter: val => val,
  // Formatting at the end of inputting
  sufFormatter: val => val,
  maxlength: null,
  readonly: false,
  // Fixed unexpected action of auto-fill in chrome and firefox
  autocomplete: 'off',
  autofocus: false,
  disabled: false,
}

Events

NameEmittedDataDescription
inputString
checkObjectExample: { valid: true, pristine: true }
3.7.0

6 years ago

3.6.0

6 years ago

3.5.3

6 years ago

3.5.2

6 years ago

3.5.1

6 years ago

3.5.0

6 years ago

3.4.3

6 years ago

3.4.2

6 years ago

3.4.1

6 years ago

3.4.0

6 years ago

3.3.1

6 years ago

3.3.0

6 years ago

3.2.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.9.0

7 years ago

1.8.0

7 years ago

1.6.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago