From 397af4f50a76111f20480cb2e6d0af7faf6d85bf Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 24 Feb 2021 16:09:57 +0800 Subject: [PATCH] docs: fix some mistakes (#8208) --- src/area/README.md | 10 +++++----- src/area/README.zh-CN.md | 12 ++++++------ src/datetime-picker/README.md | 6 ++++-- src/datetime-picker/README.zh-CN.md | 6 ++++-- src/dropdown-menu/README.md | 2 +- src/dropdown-menu/README.zh-CN.md | 2 +- src/picker/README.md | 2 -- src/picker/README.zh-CN.md | 2 -- src/uploader/README.md | 9 ++++----- src/uploader/README.zh-CN.md | 9 ++++----- 10 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/area/README.md b/src/area/README.md index 926097abe..e96be9c99 100644 --- a/src/area/README.md +++ b/src/area/README.md @@ -103,10 +103,10 @@ An object contains three properties: `province_list`, `city_list` and `county_li Example of `AreaList` ```js -{ +export default { province_list: { 110000: 'Beijing', - 330000: 'Zhejiang Province' + 330000: 'Zhejiang Province', }, city_list: { 110100: 'Beijing City', @@ -116,12 +116,12 @@ Example of `AreaList` 110101: 'Dongcheng District', 110102: 'Xicheng District', 110105: 'Chaoyang District', - 110106: 'Fengtai District' + 110106: 'Fengtai District', 330105: 'Gongshu District', 330106: 'Xihu District', // .... - } -} + }, +}; ``` All code of China: [Area.json](https://github.com/youzan/vant/blob/dev/src/area/demo/area-en.js) diff --git a/src/area/README.zh-CN.md b/src/area/README.zh-CN.md index 98ce5d20b..bf54b2bbe 100644 --- a/src/area/README.zh-CN.md +++ b/src/area/README.zh-CN.md @@ -105,30 +105,30 @@ app.use(Area); `AreaList`具体格式如下: ```js -{ +export default { province_list: { 110000: '北京市', - 120000: '天津市' + 120000: '天津市', }, city_list: { 110100: '北京市', 110200: '县', 120100: '天津市', - 120200: '县' + 120200: '县', }, county_list: { 110101: '东城区', 110102: '西城区', 110105: '朝阳区', - 110106: '丰台区' + 110106: '丰台区', 120101: '和平区', 120102: '河东区', 120103: '河西区', 120104: '南开区', 120105: '河北区', // .... - } -} + }, +}; ``` 完整数据见 [Area.json](https://github.com/youzan/vant/blob/dev/src/area/demo/area.js) diff --git a/src/datetime-picker/README.md b/src/datetime-picker/README.md index 0c5f0b65a..d499f1b4d 100644 --- a/src/datetime-picker/README.md +++ b/src/datetime-picker/README.md @@ -66,7 +66,8 @@ export default { const formatter = (type, val) => { if (type === 'year') { return `${val} Year`; - } else if (type === 'month') { + } + if (type === 'month') { return `${val} Month`; } return val; @@ -105,7 +106,8 @@ export default { const formatter = (type, val) => { if (type === 'month') { return `${val} Month`; - } else if (type === 'day') { + } + if (type === 'day') { return `${val} Day`; } return val; diff --git a/src/datetime-picker/README.zh-CN.md b/src/datetime-picker/README.zh-CN.md index 27ebfbe0d..8ed72d3e1 100644 --- a/src/datetime-picker/README.zh-CN.md +++ b/src/datetime-picker/README.zh-CN.md @@ -70,7 +70,8 @@ export default { const formatter = (type, val) => { if (type === 'year') { return `${val}年`; - } else if (type === 'month') { + } + if (type === 'month') { return `${val}月`; } return val; @@ -111,7 +112,8 @@ export default { const formatter = (type, val) => { if (type === 'month') { return `${val}月`; - } else if (type === 'day') { + } + if (type === 'day') { return `${val}日`; } return val; diff --git a/src/dropdown-menu/README.md b/src/dropdown-menu/README.md index 0161d1f16..f286ed726 100644 --- a/src/dropdown-menu/README.md +++ b/src/dropdown-menu/README.md @@ -99,7 +99,7 @@ export default { return { item, state, - option, + options, onConfirm, }; }, diff --git a/src/dropdown-menu/README.zh-CN.md b/src/dropdown-menu/README.zh-CN.md index 8bd096690..f8cc29894 100644 --- a/src/dropdown-menu/README.zh-CN.md +++ b/src/dropdown-menu/README.zh-CN.md @@ -105,7 +105,7 @@ export default { return { item, state, - option, + options, onConfirm, }; }, diff --git a/src/picker/README.md b/src/picker/README.md index 837f50d58..c37b19601 100644 --- a/src/picker/README.md +++ b/src/picker/README.md @@ -267,8 +267,6 @@ export default { ``` ```js -import { reactive } from 'vue'; - export default { setup() { const columns = [ diff --git a/src/picker/README.zh-CN.md b/src/picker/README.zh-CN.md index 809711a40..f44f92744 100644 --- a/src/picker/README.zh-CN.md +++ b/src/picker/README.zh-CN.md @@ -290,8 +290,6 @@ export default { ``` ```js -import { reactive } from 'vue'; - export default { setup() { const columns = [ diff --git a/src/uploader/README.md b/src/uploader/README.md index 0e86e52f3..8808ec836 100644 --- a/src/uploader/README.md +++ b/src/uploader/README.md @@ -199,7 +199,7 @@ export default { Toast('Please upload an image in jpg format'); reject(); } else { - let img = new File(['foo'], 'bar.jpg', { + const img = new File(['foo'], 'bar.jpg', { type: 'image/jpeg', }); resolve(img); @@ -251,10 +251,9 @@ export default { previewSize: 120, }, ]); - return { - fileList: - }; - } + + return { fileList }; + }, }; ``` diff --git a/src/uploader/README.zh-CN.md b/src/uploader/README.zh-CN.md index d52f908cf..2c2f191be 100644 --- a/src/uploader/README.zh-CN.md +++ b/src/uploader/README.zh-CN.md @@ -222,7 +222,7 @@ export default { Toast('请上传 jpg 格式图片'); reject(); } else { - let img = new File(['foo'], 'bar.jpg', { + const img = new File(['foo'], 'bar.jpg', { type: 'image/jpeg', }); resolve(img); @@ -276,10 +276,9 @@ export default { previewSize: 120, }, ]); - return { - fileList: - }; - } + + return { fileList }; + }, }; ```