docs(NumberKeyboard): use composition api

This commit is contained in:
chenjiahan
2020-12-13 13:50:16 +08:00
parent 75f8e36923
commit f66dcdc8c0
3 changed files with 92 additions and 68 deletions
+20 -13
View File
@@ -25,21 +25,24 @@ app.use(NumberKeyboard);
```
```js
import { ref } from 'vue';
import { Toast } from 'vant';
export default {
data() {
return {
show: true,
};
},
methods: {
onInput(value) {
setup() {
const show = ref(true);
const onInput = (value) => {
Toast(value);
},
onDelete() {
};
const onDelete = () => {
Toast('delete');
},
};
return {
show,
onInput,
onDelete,
};
},
};
```
@@ -125,11 +128,15 @@ Use `title` prop to set keyboard title.
```
```js
import { ref } from 'vue';
export default {
data() {
setup() {
const show = ref(true);
const value = ref('');
return {
show: false,
value: '',
show,
value,
};
},
};