mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
docs(Contact): split demo and document (#7484)
This commit is contained in:
50
src/contact-edit/demo/index.vue
Normal file
50
src/contact-edit/demo/index.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<demo-section>
|
||||
<demo-block :title="t('basicUsage')">
|
||||
<van-contact-edit
|
||||
is-edit
|
||||
show-set-default
|
||||
:contact-info="editingContact"
|
||||
:set-default-label="t('defaultLabel')"
|
||||
@save="onSave"
|
||||
@delete="onDelete"
|
||||
/>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
defaultLabel: '设为默认联系人',
|
||||
},
|
||||
'en-US': {
|
||||
defaultLabel: 'Set as the default contact',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
editingContact: {},
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSave() {
|
||||
this.$toast(this.t('save'));
|
||||
},
|
||||
onDelete() {
|
||||
this.$toast(this.t('delete'));
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.demo-contact-edit {
|
||||
.van-doc-demo-block__title {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user