docs(ContactEdit): use composition api

This commit is contained in:
chenjiahan
2020-12-13 14:23:36 +08:00
parent 4d888702de
commit 03e65d9427
3 changed files with 54 additions and 40 deletions
+13 -10
View File
@@ -26,21 +26,24 @@ app.use(ContactEdit);
```
```js
import { ref } from 'vue';
import { Toast } from 'vant';
export default {
data() {
return {
editingContact: {},
};
},
methods: {
onSave(contactInfo) {
setup() {
const editingContact = ref({});
const onSave = (contactInfo) => {
Toast('Save');
},
onDelete(contactInfo) {
};
const onDelete = (contactInfo) => {
Toast('Delete');
},
};
return {
onSave,
onDelete,
editingContact,
};
},
};
```