diff --git a/packages/vant-cli/site/desktop/components/Header.vue b/packages/vant-cli/site/desktop/components/Header.vue
index 175482753..0501ff13d 100644
--- a/packages/vant-cli/site/desktop/components/Header.vue
+++ b/packages/vant-cli/site/desktop/components/Header.vue
@@ -262,7 +262,7 @@ export default {
&__subtitle {
display: inline-block;
color: #999;
- margin-left: 8px;
+ margin-left: 4px;
vertical-align: -4px;
font-size: 13px;
}
diff --git a/packages/vant/src/contact-edit/README.md b/packages/vant/src/contact-edit/README.md
index f0571c6d7..2f3446c53 100644
--- a/packages/vant/src/contact-edit/README.md
+++ b/packages/vant/src/contact-edit/README.md
@@ -37,7 +37,10 @@ import { Toast } from 'vant';
export default {
setup() {
- const editingContact = ref({});
+ const editingContact = ref({
+ tel: '',
+ name: '',
+ });
const onSave = (contactInfo) => Toast('Save');
const onDelete = (contactInfo) => Toast('Delete');
return {
diff --git a/packages/vant/src/contact-edit/README.zh-CN.md b/packages/vant/src/contact-edit/README.zh-CN.md
index 6b19dcf7b..4409314aa 100644
--- a/packages/vant/src/contact-edit/README.zh-CN.md
+++ b/packages/vant/src/contact-edit/README.zh-CN.md
@@ -37,7 +37,10 @@ import { Toast } from 'vant';
export default {
setup() {
- const editingContact = ref({});
+ const editingContact = ref({
+ tel: '',
+ name: '',
+ });
const onSave = (contactInfo) => Toast('保存');
const onDelete = (contactInfo) => Toast('删除');
return {
diff --git a/packages/vant/src/contact-edit/demo/index.vue b/packages/vant/src/contact-edit/demo/index.vue
index 7e36f7ee8..23405172c 100644
--- a/packages/vant/src/contact-edit/demo/index.vue
+++ b/packages/vant/src/contact-edit/demo/index.vue
@@ -1,6 +1,6 @@
diff --git a/packages/vant/src/stepper/demo/index.vue b/packages/vant/src/stepper/demo/index.vue
index 33db318de..b28273b29 100644
--- a/packages/vant/src/stepper/demo/index.vue
+++ b/packages/vant/src/stepper/demo/index.vue
@@ -42,7 +42,7 @@ const disabledInput = ref(1);
const beforeChange = () => {
Toast.loading({ forbidClick: true });
- return new Promise((resolve) => {
+ return new Promise((resolve) => {
setTimeout(() => {
Toast.clear();
resolve(true);
diff --git a/packages/vant/src/sticky/demo/index.vue b/packages/vant/src/sticky/demo/index.vue
index 4b77033ac..2e8e3a4d0 100644
--- a/packages/vant/src/sticky/demo/index.vue
+++ b/packages/vant/src/sticky/demo/index.vue
@@ -17,7 +17,7 @@ const t = useTranslate({
},
});
-const container = ref(null);
+const container = ref();
diff --git a/packages/vant/src/swipe-cell/demo/index.vue b/packages/vant/src/swipe-cell/demo/index.vue
index 77a1e7ebd..8553dd3ae 100644
--- a/packages/vant/src/swipe-cell/demo/index.vue
+++ b/packages/vant/src/swipe-cell/demo/index.vue
@@ -38,10 +38,12 @@ const beforeClose = ({ position }: { position: string }) => {
case 'outside':
return true;
case 'right':
- return new Promise((resolve) => {
+ return new Promise((resolve) => {
Dialog.confirm({
title: t('confirm'),
- }).then(resolve);
+ }).then(() => {
+ resolve(true);
+ });
});
}
};
diff --git a/packages/vant/src/tab/demo/index.vue b/packages/vant/src/tab/demo/index.vue
index 4f648cdae..9f7f4b586 100644
--- a/packages/vant/src/tab/demo/index.vue
+++ b/packages/vant/src/tab/demo/index.vue
@@ -64,7 +64,7 @@ const beforeChange = (name: number) => {
if (name === 1) {
return false;
}
- return new Promise((resolve) => {
+ return new Promise((resolve) => {
resolve(name !== 3);
});
};
diff --git a/packages/vant/src/uploader/test/index.spec.ts b/packages/vant/src/uploader/test/index.spec.ts
index 38295523a..73cac2700 100644
--- a/packages/vant/src/uploader/test/index.spec.ts
+++ b/packages/vant/src/uploader/test/index.spec.ts
@@ -99,7 +99,7 @@ test('set input name', (done) => {
detail: { name: string | number; index: number }
) => {
expect(detail.name).toEqual('uploader');
- return file;
+ return true;
},
afterRead: (
readFile: UploaderFileListItem | UploaderFileListItem[],
diff --git a/packages/vant/src/uploader/types.ts b/packages/vant/src/uploader/types.ts
index 883181ce3..2b422c862 100644
--- a/packages/vant/src/uploader/types.ts
+++ b/packages/vant/src/uploader/types.ts
@@ -26,7 +26,7 @@ export type UploaderBeforeRead = (
name: string | number;
index: number;
}
-) => boolean | Promise;
+) => boolean | undefined | Promise;
export type UploaderAfterRead = (
items: UploaderFileListItem | UploaderFileListItem[],