diff --git a/package.json b/package.json index 24d9e40a2..e1e67e183 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ }, "devDependencies": { "@vant/cli": "^2.7.0", - "prettier": "^2.0.4", + "prettier": "2.1.0", "vue": "^2.6.12", "vue-template-compiler": "^2.6.12" }, diff --git a/src/empty/README.md b/src/empty/README.md index ff3bdf7e2..8c5fce515 100644 --- a/src/empty/README.md +++ b/src/empty/README.md @@ -50,9 +50,7 @@ Use the image prop to display different placeholder images. ```html <van-empty description="Description"> - <van-button round type="danger" class="bottom-button"> - Button - </van-button> + <van-button round type="danger" class="bottom-button">Button</van-button> </van-empty> <style> diff --git a/src/empty/README.zh-CN.md b/src/empty/README.zh-CN.md index 419b56230..dc46b5d34 100644 --- a/src/empty/README.zh-CN.md +++ b/src/empty/README.zh-CN.md @@ -59,9 +59,7 @@ Empty 组件内置了多种占位图片类型,可以在不同业务场景下 ```html <van-empty description="描述文字"> - <van-button round type="danger" class="bottom-button"> - 按钮 - </van-button> + <van-button round type="danger" class="bottom-button">按钮</van-button> </van-empty> <style> diff --git a/src/form/README.zh-CN.md b/src/form/README.zh-CN.md index cf6018f3c..b89b80527 100644 --- a/src/form/README.zh-CN.md +++ b/src/form/README.zh-CN.md @@ -37,9 +37,7 @@ Vue.use(Form); :rules="[{ required: true, message: '请填写密码' }]" /> <div style="margin: 16px;"> - <van-button round block type="info" native-type="submit"> - 提交 - </van-button> + <van-button round block type="info" native-type="submit">提交</van-button> </div> </van-form> ``` @@ -88,9 +86,7 @@ export default { :rules="[{ validator: asyncValidator, message: '请输入正确内容' }]" /> <div style="margin: 16px;"> - <van-button round block type="info" native-type="submit"> - 提交 - </van-button> + <van-button round block type="info" native-type="submit">提交</van-button> </div> </van-form> ``` @@ -530,9 +526,7 @@ export default { 在表单中,除了提交按钮外,可能还有一些其他的功能性按钮,如发送验证码按钮。在使用这些按钮时,要注意将`native-type`设置为`button`,否则会触发表单提交。 ```html -<van-button native-type="button"> - 发送验证码 -</van-button> +<van-button native-type="button">发送验证码</van-button> ``` 这个问题的原因是浏览器中 button 标签 type 属性的默认值为`submit`,导致触发表单提交。我们会在下个大版本中将 type 的默认值调整为`button`来避免这个问题。 diff --git a/src/notice-bar/README.md b/src/notice-bar/README.md index 7c34589b2..7746de8f0 100644 --- a/src/notice-bar/README.md +++ b/src/notice-bar/README.md @@ -33,21 +33,15 @@ Vue.use(NoticeBar); ### Wrapable ```html -<van-notice-bar wrapable :scrollable="false"> - Notice Content -</van-notice-bar> +<van-notice-bar wrapable :scrollable="false">Notice Content</van-notice-bar> ``` ### Mode ```html -<van-notice-bar mode="closeable"> - Notice Content -</van-notice-bar> +<van-notice-bar mode="closeable">Notice Content</van-notice-bar> -<van-notice-bar mode="link"> - Notice Content -</van-notice-bar> +<van-notice-bar mode="link">Notice Content</van-notice-bar> ``` ### Custom Style diff --git a/src/notice-bar/README.zh-CN.md b/src/notice-bar/README.zh-CN.md index 2dcb42b9c..a761ba477 100644 --- a/src/notice-bar/README.zh-CN.md +++ b/src/notice-bar/README.zh-CN.md @@ -59,14 +59,10 @@ Vue.use(NoticeBar); ```html <!-- closeable 模式,在右侧显示关闭按钮 --> -<van-notice-bar mode="closeable"> - 技术是开发它的人的共同灵魂。 -</van-notice-bar> +<van-notice-bar mode="closeable">技术是开发它的人的共同灵魂。</van-notice-bar> <!-- link 模式,在右侧显示链接箭头 --> -<van-notice-bar mode="link"> - 技术是开发它的人的共同灵魂。 -</van-notice-bar> +<van-notice-bar mode="link">技术是开发它的人的共同灵魂。</van-notice-bar> ``` ### 自定义样式 diff --git a/src/number-keyboard/README.md b/src/number-keyboard/README.md index 5229bf104..3e2032e33 100644 --- a/src/number-keyboard/README.md +++ b/src/number-keyboard/README.md @@ -14,9 +14,7 @@ Vue.use(NumberKeyboard); ### Default Keyboard ```html -<van-cell @touchstart.native.stop="show = true"> - Show Keyboard -</van-cell> +<van-cell @touchstart.native.stop="show = true">Show Keyboard</van-cell> <van-number-keyboard :show="show" @blur="show = false" diff --git a/src/number-keyboard/README.zh-CN.md b/src/number-keyboard/README.zh-CN.md index 2ea34310e..9949a7d14 100644 --- a/src/number-keyboard/README.zh-CN.md +++ b/src/number-keyboard/README.zh-CN.md @@ -20,9 +20,7 @@ Vue.use(NumberKeyboard); 数字键盘提供了 `input`、`delete`、`blur` 事件,分别对应输入内容、删除内容和失去焦点的动作。 ```html -<van-cell @touchstart.native.stop="show = true"> - 弹出默认键盘 -</van-cell> +<van-cell @touchstart.native.stop="show = true">弹出默认键盘</van-cell> <van-number-keyboard :show="show" @blur="show = false" diff --git a/src/popover/README.md b/src/popover/README.md index 4bcb3e789..731cc5346 100644 --- a/src/popover/README.md +++ b/src/popover/README.md @@ -21,9 +21,7 @@ Vue.use(Popover); @select="onSelect" > <template #reference> - <van-button type="primary"> - Light Theme - </van-button> + <van-button type="primary">Light Theme</van-button> </template> </van-popover> ``` @@ -62,9 +60,7 @@ Using the `theme` prop to change the style of Popover. :actions="actions" > <template #reference> - <van-button type="primary"> - Dark Theme - </van-button> + <van-button type="primary">Dark Theme</van-button> </template> </van-popover> ``` @@ -112,9 +108,7 @@ bottom-end # Bottom right ```html <van-popover v-model="showPopover" trigger="click" :actions="actions"> <template #reference> - <van-button type="primary"> - Show Icon - </van-button> + <van-button type="primary">Show Icon</van-button> </template> </van-popover> ``` @@ -141,9 +135,7 @@ Using the `disabled` option to disable an action. ```html <van-popover v-model="showPopover" trigger="click" :actions="actions"> <template #reference> - <van-button type="primary"> - Disable Action - </van-button> + <van-button type="primary">Disable Action</van-button> </template> </van-popover> ``` diff --git a/src/popover/README.zh-CN.md b/src/popover/README.zh-CN.md index 99b2af080..757ba697f 100644 --- a/src/popover/README.zh-CN.md +++ b/src/popover/README.zh-CN.md @@ -27,9 +27,7 @@ Vue.use(Popover); @select="onSelect" > <template #reference> - <van-button type="primary"> - 浅色风格 - </van-button> + <van-button type="primary">浅色风格</van-button> </template> </van-popover> ``` @@ -65,9 +63,7 @@ Popover 支持浅色和深色两种风格,默认为浅色风格,将 `theme` :actions="actions" > <template #reference> - <van-button type="primary"> - 深色风格 - </van-button> + <van-button type="primary">深色风格</van-button> </template> </van-popover> ``` @@ -115,9 +111,7 @@ bottom-end # 底部右侧位置 ```html <van-popover v-model="showPopover" trigger="click" :actions="actions"> <template #reference> - <van-button type="primary"> - 展示图标 - </van-button> + <van-button type="primary">展示图标</van-button> </template> </van-popover> ``` @@ -144,9 +138,7 @@ export default { ```html <van-popover v-model="showPopover" trigger="click" :actions="actions"> <template #reference> - <van-button type="primary"> - 禁用选项 - </van-button> + <van-button type="primary">禁用选项</van-button> </template> </van-popover> ``` @@ -188,9 +180,7 @@ export default { /> </van-grid> <template #reference> - <van-button type="primary"> - 自定义内容 - </van-button> + <van-button type="primary">自定义内容</van-button> </template> </van-popover> ``` diff --git a/src/swipe-cell/README.md b/src/swipe-cell/README.md index bc7fd3c41..881124cbf 100644 --- a/src/swipe-cell/README.md +++ b/src/swipe-cell/README.md @@ -133,10 +133,10 @@ export default { Use [ref](https://vuejs.org/v2/api/#ref) to get SwipeCell instance and call instance methods. -| Name | Description | Attribute | Return value | -| ----- | --------------- | ------------------------ | ------------ | -| open | open SwipeCell | position: `left | right` | - | -| close | close SwipeCell | - | - | +| Name | Description | Attribute | Return value | +| ----- | --------------- | ------------------------- | ------------ | +| open | open SwipeCell | position: `left \| right` | - | +| close | close SwipeCell | - | - | ### Less Variables diff --git a/src/swipe-cell/README.zh-CN.md b/src/swipe-cell/README.zh-CN.md index dc6327be4..e80f60f46 100644 --- a/src/swipe-cell/README.zh-CN.md +++ b/src/swipe-cell/README.zh-CN.md @@ -147,10 +147,10 @@ beforeClose 的第一个参数为对象,对象中包含以下属性: 通过 ref 可以获取到 SwipeCell 实例并调用实例方法,详见[组件实例方法](#/zh-CN/advanced-usage#zu-jian-shi-li-fang-fa)。 -| 方法名 | 说明 | 参数 | 返回值 | -| ------ | ---------------- | ------------------------ | ------ | -| open | 打开单元格侧边栏 | position: `left | right` | - | -| close | 收起单元格侧边栏 | - | - | +| 方法名 | 说明 | 参数 | 返回值 | +| ------ | ---------------- | ------------------------- | ------ | +| open | 打开单元格侧边栏 | position: `left \| right` | - | +| close | 收起单元格侧边栏 | - | - | ### 样式变量 diff --git a/src/swipe/README.md b/src/swipe/README.md index 208395a95..daf39a115 100644 --- a/src/swipe/README.md +++ b/src/swipe/README.md @@ -121,9 +121,7 @@ export default { <van-swipe-item>3</van-swipe-item> <van-swipe-item>4</van-swipe-item> <template #indicator> - <div class="custom-indicator"> - {{ current + 1 }}/4 - </div> + <div class="custom-indicator">{{ current + 1 }}/4</div> </template> </van-swipe> diff --git a/src/swipe/README.zh-CN.md b/src/swipe/README.zh-CN.md index a52cbe5ca..e5ff1135d 100644 --- a/src/swipe/README.zh-CN.md +++ b/src/swipe/README.zh-CN.md @@ -131,9 +131,7 @@ export default { <van-swipe-item>3</van-swipe-item> <van-swipe-item>4</van-swipe-item> <template #indicator> - <div class="custom-indicator"> - {{ current + 1 }}/4 - </div> + <div class="custom-indicator">{{ current + 1 }}/4</div> </template> </van-swipe> diff --git a/src/tabbar/README.md b/src/tabbar/README.md index 98c67a9ef..5b1b68697 100644 --- a/src/tabbar/README.md +++ b/src/tabbar/README.md @@ -136,12 +136,8 @@ export default { <router-view /> <van-tabbar route> - <van-tabbar-item replace to="/home" icon="home-o"> - Tab - </van-tabbar-item> - <van-tabbar-item replace to="/search" icon="search"> - Tab - </van-tabbar-item> + <van-tabbar-item replace to="/home" icon="home-o">Tab</van-tabbar-item> + <van-tabbar-item replace to="/search" icon="search">Tab</van-tabbar-item> </van-tabbar> ``` diff --git a/src/tabbar/README.zh-CN.md b/src/tabbar/README.zh-CN.md index 12dd04df9..9b3e5beb7 100644 --- a/src/tabbar/README.zh-CN.md +++ b/src/tabbar/README.zh-CN.md @@ -144,12 +144,8 @@ export default { <router-view /> <van-tabbar route> - <van-tabbar-item replace to="/home" icon="home-o"> - 标签 - </van-tabbar-item> - <van-tabbar-item replace to="/search" icon="search"> - 标签 - </van-tabbar-item> + <van-tabbar-item replace to="/home" icon="home-o">标签</van-tabbar-item> + <van-tabbar-item replace to="/search" icon="search">标签</van-tabbar-item> </van-tabbar> ``` diff --git a/yarn.lock b/yarn.lock index 1eb8255af..826c9ed9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9489,15 +9489,20 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier@2.1.0: + version "2.1.0" + resolved "https://registry.npm.taobao.org/prettier/download/prettier-2.1.0.tgz?cache=0&sync_timestamp=1606521234483&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.1.0.tgz#5a9789f767a243118c60f3e56d95cb6544914fbb" + integrity sha1-WpeJ92eiQxGMYPPlbZXLZUSRT7s= + prettier@^1.18.2: version "1.19.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== -prettier@^2.0.4, prettier@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" - integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== +prettier@^2.0.5: + version "2.2.1" + resolved "https://registry.npm.taobao.org/prettier/download/prettier-2.2.1.tgz?cache=0&sync_timestamp=1606521150228&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha1-eVoaeN1S8HPaDNQrIfnJE4GSP/U= pretty-error@^2.1.1: version "2.1.1"