[Improvement] Support Vue.use to register a component (#401)

This commit is contained in:
neverland
2017-12-11 20:41:19 +08:00
committed by GitHub
parent 7dbb5db256
commit 6f2b4c99da
162 changed files with 432 additions and 490 deletions
+2 -22
View File
@@ -1,23 +1,3 @@
<script>
export default {
data() {
return {
value: '',
showKeyboard: true
}
},
methods: {
onInput(key) {
this.value = (this.value + key).slice(0, 6);
},
onDelete() {
this.value = this.value.slice(0, this.value.length - 1);
}
}
}
</script>
## PasswordInput
The PasswordInput component is usually used with [NumberKeyboard](#/en-US/component/number-keyboard) Component.
@@ -25,8 +5,8 @@ The PasswordInput component is usually used with [NumberKeyboard](#/en-US/compon
``` javascript
import { PasswordInput, NumberKeyBoard } from 'vant';
Vue.component(PasswordInput.name, PasswordInput);
Vue.component(NumberKeyBoard.name, NumberKeyBoard);
Vue.use(PasswordInput);
Vue.use(NumberKeyBoard);
```
### Usage