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
@@ -31,21 +31,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('删除');
},
};
return {
show,
onInput,
onDelete,
};
},
};
```
@@ -138,11 +141,15 @@ export default {
```
```js
import { ref } from 'vue';
export default {
data() {
setup() {
const show = ref(true);
const value = ref('');
return {
show: false,
value: '',
show,
value,
};
},
};