From 44fc8b065c62302de8f95052d1f366c3843b1d12 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 24 Apr 2020 22:50:56 +0800 Subject: [PATCH] chore: prettier evenything --- build/compiler.js | 8 +- build/dev.js | 4 +- build/webpack.doc.dev.js | 50 +++--- build/webpack.doc.prd.js | 4 +- docs/markdown/changelog.md | 50 +++--- docs/markdown/custom-style.md | 4 +- docs/markdown/intro.md | 10 +- docs/markdown/quickstart.md | 1 - docs/markdown/theme.md | 15 +- docs/src/App.vue | 23 ++- docs/src/Preview.vue | 6 +- docs/src/doc.config.js | 38 ++--- docs/src/index.js | 8 +- docs/src/preview.js | 2 +- docs/src/router.js | 30 ++-- package.json | 2 +- packages/action-sheet/README.md | 85 +++++------ packages/action-sheet/index.ts | 20 +-- packages/area/README.md | 57 +++---- packages/area/index.ts | 41 ++--- packages/button/README.md | 68 +++++---- packages/button/index.ts | 18 +-- packages/calendar/README.md | 114 +++++++------- packages/calendar/components/header/index.ts | 8 +- packages/calendar/components/month/index.ts | 28 ++-- packages/calendar/index.ts | 67 ++++---- packages/calendar/utils.ts | 2 +- packages/card/README.md | 66 ++++---- packages/card/index.ts | 16 +- packages/cell-group/index.json | 2 +- packages/cell-group/index.ts | 6 +- packages/cell/README.md | 74 ++++----- packages/cell/index.json | 2 +- packages/cell/index.less | 2 +- packages/cell/index.ts | 10 +- packages/checkbox-group/index.ts | 12 +- packages/checkbox/README.md | 100 ++++++------ packages/checkbox/index.ts | 22 ++- packages/circle/README.md | 36 ++--- packages/circle/index.ts | 28 ++-- packages/col/README.md | 21 ++- packages/col/index.less | 8 +- packages/col/index.ts | 12 +- packages/collapse-item/index.ts | 23 +-- packages/collapse/README.md | 83 +++++----- packages/collapse/index.ts | 16 +- packages/common/README.md | 14 +- packages/common/component.ts | 17 ++- packages/common/style/hairline.less | 2 +- packages/count-down/README.md | 64 ++++---- packages/count-down/index.ts | 16 +- packages/count-down/utils.ts | 2 +- packages/datetime-picker/README.md | 102 ++++++------- packages/datetime-picker/index.ts | 68 ++++----- packages/definitions/index.ts | 9 +- packages/dialog/README.md | 152 ++++++++++--------- packages/dialog/dialog.ts | 28 ++-- packages/dialog/index.ts | 40 ++--- packages/divider/README.md | 30 ++-- packages/divider/index.json | 2 +- packages/divider/index.less | 2 +- packages/divider/index.ts | 18 +-- packages/dropdown-item/index.ts | 22 +-- packages/dropdown-menu/README.md | 38 ++--- packages/dropdown-menu/index.json | 2 +- packages/dropdown-menu/index.less | 4 +- packages/dropdown-menu/index.ts | 33 ++-- packages/field/README.md | 113 +++++++------- packages/field/index.json | 2 +- packages/field/index.ts | 18 +-- packages/field/props.ts | 24 +-- packages/goods-action-button/index.ts | 10 +- packages/goods-action-icon/index.ts | 6 +- packages/goods-action/README.md | 122 +++++++-------- packages/goods-action/index.ts | 6 +- packages/grid-item/index.ts | 8 +- packages/grid/README.md | 58 +++---- packages/grid/index.ts | 20 +-- packages/icon/README.md | 30 ++-- packages/icon/index.ts | 12 +- packages/image/README.md | 91 +++++------ packages/image/index.ts | 26 ++-- packages/index-anchor/index.ts | 12 +- packages/index-bar/README.md | 32 ++-- packages/index-bar/index.ts | 58 +++---- packages/info/index.ts | 4 +- packages/loading/README.md | 28 ++-- packages/loading/index.json | 2 +- packages/loading/index.ts | 4 +- packages/mixins/basic.ts | 13 +- packages/mixins/button.ts | 4 +- packages/mixins/link.ts | 8 +- packages/mixins/open-type.ts | 4 +- packages/mixins/page-scroll.ts | 4 +- packages/mixins/touch.ts | 7 +- packages/mixins/transition.ts | 28 ++-- packages/nav-bar/README.md | 45 +++--- packages/nav-bar/index.ts | 20 +-- packages/notice-bar/README.md | 44 +++--- packages/notice-bar/index.json | 2 +- packages/notice-bar/index.ts | 36 ++--- packages/notify/README.md | 34 ++--- packages/notify/index.ts | 17 +-- packages/notify/notify.ts | 4 +- packages/overlay/README.md | 37 +++-- packages/overlay/index.ts | 11 +- packages/panel/README.md | 30 ++-- packages/panel/index.ts | 4 +- packages/picker-column/index.json | 2 +- packages/picker-column/index.ts | 18 +-- packages/picker/README.md | 73 ++++----- packages/picker/index.less | 8 +- packages/picker/index.ts | 29 ++-- packages/picker/shared.ts | 10 +- packages/popup/README.md | 56 +++---- packages/popup/index.ts | 28 ++-- packages/progress/README.md | 37 ++--- packages/progress/index.ts | 12 +- packages/radio-group/index.ts | 16 +- packages/radio/README.md | 86 +++++------ packages/radio/index.ts | 12 +- packages/rate/README.md | 69 ++++----- packages/rate/index.ts | 26 ++-- packages/row/index.less | 2 +- packages/row/index.ts | 12 +- packages/search/README.md | 84 +++++----- packages/search/index.ts | 16 +- packages/sidebar-item/index.ts | 11 +- packages/sidebar/README.md | 8 +- packages/sidebar/index.ts | 10 +- packages/skeleton/README.md | 33 ++-- packages/skeleton/index.json | 2 +- packages/skeleton/index.less | 5 +- packages/skeleton/index.ts | 16 +- packages/slider/README.md | 56 +++---- packages/slider/index.ts | 39 ++--- packages/stepper/README.md | 42 ++--- packages/stepper/index.json | 2 +- packages/stepper/index.ts | 30 ++-- packages/steps/README.md | 47 +++--- packages/steps/index.ts | 12 +- packages/sticky/README.md | 20 +-- packages/sticky/index.ts | 30 ++-- packages/submit-bar/README.md | 56 ++++--- packages/submit-bar/index.ts | 30 ++-- packages/swipe-cell/README.md | 86 ++++++----- packages/switch/README.md | 49 +++--- packages/switch/index.ts | 14 +- packages/tab/README.md | 86 +++++------ packages/tab/index.json | 2 +- packages/tab/index.ts | 20 +-- packages/tabbar-item/index.ts | 8 +- packages/tabbar/README.md | 67 ++++---- packages/tabbar/index.ts | 22 +-- packages/tabs/index.less | 4 +- packages/tabs/index.ts | 64 ++++---- packages/tag/README.md | 26 ++-- packages/tag/index.ts | 8 +- packages/toast/README.md | 46 +++--- packages/toast/index.ts | 14 +- packages/toast/toast.ts | 18 ++- packages/transition/README.md | 54 +++---- packages/transition/index.json | 2 +- packages/transition/index.ts | 4 +- packages/tree-select/README.md | 57 ++++--- packages/tree-select/index.ts | 18 +-- packages/uploader/README.md | 88 +++++------ packages/uploader/index.ts | 62 ++++---- packages/uploader/shared.ts | 16 +- packages/uploader/utils.ts | 10 +- yarn.lock | 8 +- 171 files changed, 2452 insertions(+), 2451 deletions(-) diff --git a/build/compiler.js b/build/compiler.js index 5af48f08..5678e334 100644 --- a/build/compiler.js +++ b/build/compiler.js @@ -20,7 +20,7 @@ const exampleDir = path.resolve(__dirname, '../example/dist'); const baseCssPath = path.resolve(__dirname, '../packages/common/index.wxss'); -const lessCompiler = dist => +const lessCompiler = (dist) => function compileLess() { return gulp .src(`${src}/**/*.less`) @@ -55,21 +55,21 @@ const copier = (dist, ext) => return gulp.src(`${src}/**/*.${ext}`).pipe(gulp.dest(dist)); }; -const staticCopier = dist => +const staticCopier = (dist) => gulp.parallel( copier(dist, 'wxml'), copier(dist, 'wxs'), copier(dist, 'json') ); -const cleaner = path => +const cleaner = (path) => function clean() { return exec(`npx rimraf ${path}`); }; const tasks = [ ['buildEs', esDir, esConfig], - ['buildLib', libDir, libConfig] + ['buildLib', libDir, libConfig], ].reduce((prev, [name, ...args]) => { prev[name] = gulp.series( cleaner(...args), diff --git a/build/dev.js b/build/dev.js index 720f0350..813669c9 100644 --- a/build/dev.js +++ b/build/dev.js @@ -8,5 +8,5 @@ const gulpConfig = path.resolve(__dirname, './compiler.js'); serve({}, { config }); const p = exec(`npx gulp -f ${gulpConfig} buildExample --color`); -p.stdout.on('data', stdout => console.info(stdout)); -p.stderr.on('data', stderr => console.info(stderr)); +p.stdout.on('data', (stdout) => console.info(stdout)); +p.stderr.on('data', (stderr) => console.info(stderr)); diff --git a/build/webpack.doc.dev.js b/build/webpack.doc.dev.js index f5a8c7e9..1370fded 100644 --- a/build/webpack.doc.dev.js +++ b/build/webpack.doc.dev.js @@ -7,30 +7,30 @@ module.exports = { mode: 'development', entry: { 'vant-docs': './docs/src/index.js', - 'vant-preview': './docs/src/preview.js' + 'vant-preview': './docs/src/preview.js', }, output: { path: path.join(__dirname, '../docs/dist'), publicPath: '/', - chunkFilename: 'async_[name].js' + chunkFilename: 'async_[name].js', }, stats: { modules: false, - children: false + children: false, }, serve: { open: true, host: '0.0.0.0', devMiddleware: { - logLevel: 'warn' + logLevel: 'warn', }, hotClient: { logLevel: 'warn', - allEntries: true - } + allEntries: true, + }, }, resolve: { - extensions: ['.js', '.vue', '.css'] + extensions: ['.js', '.vue', '.css'], }, module: { rules: [ @@ -41,34 +41,26 @@ module.exports = { loader: 'vue-loader', options: { compilerOptions: { - preserveWhitespace: false - } - } - } - ] + preserveWhitespace: false, + }, + }, + }, + ], }, { test: /\.js$/, exclude: /node_modules/, - use: 'babel-loader' + use: 'babel-loader', }, { test: /\.(css|less)$/, - use: [ - 'style-loader', - 'css-loader', - 'postcss-loader', - 'less-loader' - ] + use: ['style-loader', 'css-loader', 'postcss-loader', 'less-loader'], }, { test: /\.md$/, - use: [ - 'vue-loader', - '@vant/markdown-loader' - ] - } - ] + use: ['vue-loader', '@vant/markdown-loader'], + }, + ], }, plugins: [ new VueLoaderPlugin(), @@ -77,13 +69,13 @@ module.exports = { chunks: ['vant-docs'], template: 'docs/src/index.tpl', filename: 'index.html', - inject: true + inject: true, }), new HtmlWebpackPlugin({ chunks: ['vant-preview'], template: 'docs/src/index.tpl', filename: 'preview.html', - inject: true - }) - ] + inject: true, + }), + ], }; diff --git a/build/webpack.doc.prd.js b/build/webpack.doc.prd.js index 7269fced..ae625e80 100644 --- a/build/webpack.doc.prd.js +++ b/build/webpack.doc.prd.js @@ -9,6 +9,6 @@ module.exports = Object.assign(config, { path: path.join(__dirname, '../docs/dist'), publicPath: 'https://b.yzcdn.cn/vant-weapp/', filename: '[name].[hash:8].js', - chunkFilename: 'async_[name].[chunkhash:8].js' - } + chunkFilename: 'async_[name].[chunkhash:8].js', + }, }); diff --git a/docs/markdown/changelog.md b/docs/markdown/changelog.md index 348826cd..1685f27b 100644 --- a/docs/markdown/changelog.md +++ b/docs/markdown/changelog.md @@ -1,7 +1,7 @@ # 更新日志 - ### [v1.2.2](https://github.com/youzan/vant-weapp/tree/v1.2.2) + `2020-04-21` **Features** @@ -16,6 +16,7 @@ - Field: 避免设置 showClear 为 undefined [\#3012](https://github.com/youzan/vant-weapp/pull/3012) ### [v1.2.1](https://github.com/youzan/vant-weapp/tree/v1.2.1) + `2020-04-12` **Features** @@ -30,6 +31,7 @@ - Field: 修复 autosize 属性 设置 max-height 不生效 [\#3007](https://github.com/youzan/vant-weapp/pull/3007) ### [v1.2.0](https://github.com/youzan/vant-weapp/tree/v1.2.0) + `2020-04-04` **Features** @@ -50,20 +52,21 @@ - Tab: 修复 type 为 card 时 color 对边框无效 [\#2941](https://github.com/youzan/vant-weapp/pull/2941) ### [v1.1.0](https://github.com/youzan/vant-weapp/tree/v1.1.0) + `2020-03-21` **Features** -- 新增 Calendar 日历组件 [\#2894](https://github.com/youzan/vant-weapp/pull/2894) +- 新增 Calendar 日历组件 [\#2894](https://github.com/youzan/vant-weapp/pull/2894) - Grid: 新增外部样式类 custom-class、content-class、icon-class、text-class [\#2882](https://github.com/youzan/vant-weapp/pull/2882) - Steps: 新增 click 事件 [\#2874](https://github.com/youzan/vant-weapp/pull/2874) - SideBar: 新增 title 插槽 [\#2873](https://github.com/youzan/vant-weapp/pull/2873) - Uploader: 新增 upload-icon 属性 [\#2869](https://github.com/youzan/vant-weapp/pull/2869) - Uploader: 新增 show-upload 属性 [\#2868](https://github.com/youzan/vant-weapp/pull/2868) -- Uploader: 更新样式、调整事件触发顺序与vant一致 [\#2886](https://github.com/youzan/vant-weapp/pull/2886) +- Uploader: 更新样式、调整事件触发顺序与 vant 一致 [\#2886](https://github.com/youzan/vant-weapp/pull/2886) - Field: 新增 show-word-limit 属性 [\#2856](https://github.com/youzan/vant-weapp/pull/2856) - Field: autosize 属性支持传入对象,指定 maxHeight 与 minHeight [\#2856](https://github.com/youzan/vant-weapp/pull/2856) -- Field: 新增若干CSS变量 [\#2856](https://github.com/youzan/vant-weapp/pull/2856) +- Field: 新增若干 CSS 变量 [\#2856](https://github.com/youzan/vant-weapp/pull/2856) **Bug Fixes** @@ -71,6 +74,7 @@ - Button: 修复 disabled 属性对原生事件无效 [\#2878](https://github.com/youzan/vant-weapp/pull/2878) ### [v1.0.7](https://github.com/youzan/vant-weapp/tree/v1.0.7) + `2020-03-04` **Features** @@ -84,19 +88,20 @@ - Tab: 修复内容项高度不同时粘性布局异常 [\#2817](https://github.com/youzan/vant-weapp/pull/2817) - Picker: 修复未选中项样式未置灰 [\#2816](https://github.com/youzan/vant-weapp/pull/2816) -- GoodsActionButton: 修复仅使用一个button时样式异常 [\#2808](https://github.com/youzan/vant-weapp/pull/2808) +- GoodsActionButton: 修复仅使用一个 button 时样式异常 [\#2808](https://github.com/youzan/vant-weapp/pull/2808) - Radio: `name`类型与`value`统一 [\#2801](https://github.com/youzan/vant-weapp/pull/2801) - Uploader: 修复文档错误 [\#2777](https://github.com/youzan/vant-weapp/pull/2777) ### [v1.0.6](https://github.com/youzan/vant-weapp/tree/v1.0.6) + `2020-02-24` **Features** -- GoodsActionButton: 新增默认slot [\#2779](https://github.com/youzan/vant-weapp/pull/2779) +- GoodsActionButton: 新增默认 slot [\#2779](https://github.com/youzan/vant-weapp/pull/2779) - SubmitBar: 更新圆角样式 [\#2755](https://github.com/youzan/vant-weapp/pull/2755) - Card: 更新样式 [\#2754](https://github.com/youzan/vant-weapp/pull/2754) -- 优化relation部分代码 [\#2760](https://github.com/youzan/vant-weapp/pull/2760) +- 优化 relation 部分代码 [\#2760](https://github.com/youzan/vant-weapp/pull/2760) **Bug Fixes** @@ -108,15 +113,16 @@ - Radio: 修复`label-disabled`文档错误 [\#2763](https://github.com/youzan/vant-weapp/pull/2763) ### [v1.0.5](https://github.com/youzan/vant-weapp/tree/v1.0.5) + `2020-02-07` **Features** - ActionSheet: actions 支持更多 openType [\#2715](https://github.com/youzan/vant-weapp/pull/2715) - Uploader: 新增开始`disabled`时的组件样式 [\#2720](https://github.com/youzan/vant-weapp/pull/2720) -- Icon: 调整示例小程序页面与vant对齐 [\#2728](https://github.com/youzan/vant-weapp/pull/2728) -- 示例小程序首页与vant对齐 [\#2729](https://github.com/youzan/vant-weapp/pull/2729) -- 完善快速上手文档,增加npm构建说明 [\#2726](https://github.com/youzan/vant-weapp/pull/2726) +- Icon: 调整示例小程序页面与 vant 对齐 [\#2728](https://github.com/youzan/vant-weapp/pull/2728) +- 示例小程序首页与 vant 对齐 [\#2729](https://github.com/youzan/vant-weapp/pull/2729) +- 完善快速上手文档,增加 npm 构建说明 [\#2726](https://github.com/youzan/vant-weapp/pull/2726) **Bug Fixes** @@ -127,6 +133,7 @@ - TreeSelect: 修正文档示例代码标签闭合错误 [\#2710](https://github.com/youzan/vant-weapp/pull/2710) ### [v1.0.4](https://github.com/youzan/vant-weapp/tree/v1.0.4) + `2020-01-21` **Features** @@ -144,11 +151,12 @@ - 升级依赖版本以避免安全警告 [\#2680](https://github.com/youzan/vant-weapp/pull/2680) ### [v1.0.3](https://github.com/youzan/vant-weapp/tree/v1.0.3) + `2020-01-09` **Features** -- npm包默认输出es5版本代码 [\#2639](https://github.com/youzan/vant-weapp/pull/2639) +- npm 包默认输出 es5 版本代码 [\#2639](https://github.com/youzan/vant-weapp/pull/2639) - Steps: 新增外部样式类 desc-class [\#2630](https://github.com/youzan/vant-weapp/pull/2630) **Bug Fixes** @@ -157,23 +165,26 @@ - NavBar: 修复返回图标未居中的问题 [\#2633](https://github.com/youzan/vant-weapp/pull/2633) ### [v1.0.2](https://github.com/youzan/vant-weapp/tree/v1.0.2) + `2019-12-31` **Features** -- Skeleton: 新增外部样式类`row-class``avatar-class``title-class` [\#2612](https://github.com/youzan/vant-weapp/pull/2612) +- Skeleton: 新增外部样式类` row-class``avatar-class``title-class ` [\#2612](https://github.com/youzan/vant-weapp/pull/2612) - SwipeCell: 支持动态修改`width`属性 [\#2607](https://github.com/youzan/vant-weapp/pull/2607) -- Uploader: 新增`camera``compressed``maxDuration`属性 [\#2584](https://github.com/youzan/vant-weapp/pull/2584) +- Uploader: 新增` camera``compressed``maxDuration `属性 [\#2584](https://github.com/youzan/vant-weapp/pull/2584) **Improvements** + - Tab: 优化弹性滚动效果 [\#2606](https://github.com/youzan/vant-weapp/pull/2606) **Bug Fixes** -- IndexBar: 修复字母未全部定义时click事件报错 [\#2605](https://github.com/youzan/vant-weapp/pull/2605) +- IndexBar: 修复字母未全部定义时 click 事件报错 [\#2605](https://github.com/youzan/vant-weapp/pull/2605) - Field: 修复点击清除图标后下一次点击无效 [\#2602](https://github.com/youzan/vant-weapp/pull/2602) ### [v1.0.1](https://github.com/youzan/vant-weapp/tree/v1.0.1) + `2019-12-23` **Features** @@ -195,6 +206,7 @@ - Uploader: 修复 capture 属性不生效 [\#2551](https://github.com/youzan/vant-weapp/pull/2551) ### [v1.0.0](https://github.com/youzan/vant-weapp/tree/v1.0.0) + `2019-12-11` #### 主要变动 @@ -203,7 +215,7 @@ - 增加十一个新组件 - 增加数十个 API - 所有组件支持通过`CSS自定义属性`自定义样式 -- 使用`env()`重构iOS安全区域适配 +- 使用`env()`重构 iOS 安全区域适配 - 调整部分 API 命名,废除少量 API #### 新组件 @@ -230,9 +242,9 @@ 微信小程序的环境是非常特殊的。不具有动态加载代码的机制,同时微信又限制了代码的主包大小和总大小。传统的基于预设的样式定制过于臃肿,不再适合微信小程序的环境。 -微信小程序自定义组件的组件模型相当于一个简化版的 [Shadow DOM](https://developers.google.com/web/fundamentals/web-components/shadowdom?hl=zh-CN),幸运的是,小程序也支持了 [CSS自定义属性](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties) 的特性。最终,我们基于CSS自定义属性设计了样式定制的方案,开发者使用灵活、方便,组件维护也更简单。 +微信小程序自定义组件的组件模型相当于一个简化版的 [Shadow DOM](https://developers.google.com/web/fundamentals/web-components/shadowdom?hl=zh-CN),幸运的是,小程序也支持了 [CSS 自定义属性](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties) 的特性。最终,我们基于 CSS 自定义属性设计了样式定制的方案,开发者使用灵活、方便,组件维护也更简单。 -从 1.0 版本开始,Vant Weapp 中的所有组件都支持通过 [CSS组定义属性](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties) 进行样式定制,具体使用姿势可查看[相关文档](https://youzan.github.io/vant-weapp/#/theme) +从 1.0 版本开始,Vant Weapp 中的所有组件都支持通过 [CSS 组定义属性](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties) 进行样式定制,具体使用姿势可查看[相关文档](https://youzan.github.io/vant-weapp/#/theme) ![定制主题](https://img.yzcdn.cn/public_files/2019/06/11/9a066c1a212264c7ae56065e1f13d317.png) @@ -263,7 +275,7 @@ - 去除`transitionend`事件,新增 6 个事件 ----- +--- #### 新特性 @@ -404,7 +416,7 @@ - 新增`input-width`属性 - 新增`button-size`属性 - 新增`decimalLength`属性 -- 新增 disablePlus、disableMinus属性 +- 新增 disablePlus、disableMinus 属性 ##### Steps diff --git a/docs/markdown/custom-style.md b/docs/markdown/custom-style.md index 6f24af59..a9bfb33b 100644 --- a/docs/markdown/custom-style.md +++ b/docs/markdown/custom-style.md @@ -35,8 +35,8 @@ Vant Weapp 的所有组件都开启了`addGlobalClass: true`以接受外部样 ```js Component({ options: { - styleIsolation: 'shared' - } + styleIsolation: 'shared', + }, }); ``` diff --git a/docs/markdown/intro.md b/docs/markdown/intro.md index 514fd3b8..288255ae 100644 --- a/docs/markdown/intro.md +++ b/docs/markdown/intro.md @@ -40,11 +40,11 @@ Vant Weapp 是移动端 Vue 组件库 [Vant](https://github.com/youzan/vant) 的 ### 链接 -* [意见反馈](https://github.com/youzan/vant-weapp/issues) -* [加入我们](https://job.youzan.com) -* [更新日志](#/changelog) -* [Vue 组件库](https://github.com/youzan/vant) -* [React 组件库](https://www.youzanyun.com/zanui/zent) +- [意见反馈](https://github.com/youzan/vant-weapp/issues) +- [加入我们](https://job.youzan.com) +- [更新日志](#/changelog) +- [Vue 组件库](https://github.com/youzan/vant) +- [React 组件库](https://www.youzanyun.com/zanui/zent) ### 开源协议 diff --git a/docs/markdown/quickstart.md b/docs/markdown/quickstart.md index db55c18a..4ce20739 100644 --- a/docs/markdown/quickstart.md +++ b/docs/markdown/quickstart.md @@ -44,7 +44,6 @@ npm i vant-weapp -S --production } ``` - ### 步骤四 修改 app.json 将 app.json 中的 `"style": "v2"` 去除,小程序的[新版基础组件](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#style)强行加上了许多样式,难以去除,不关闭将造成部分组件样式混乱。 diff --git a/docs/markdown/theme.md b/docs/markdown/theme.md index a971d800..a12c243c 100644 --- a/docs/markdown/theme.md +++ b/docs/markdown/theme.md @@ -4,7 +4,7 @@ 小程序基于 [Shadow DOM](https://developers.google.com/web/fundamentals/web-components/shadowdom?hl=zh-cn) 来实现自定义组件,所以 Vant Weapp 使用与之配套的 [Css 变量](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Using_CSS_custom_properties) 来实现定制主题。链接中的内容可以帮助你对这两个概念有基本的认识,避免许多不必要的困扰。 -Css变量 的兼容性要求可以在 [这里](https://caniuse.com/#feat=css-variables) 查看。对于不支持 Css变量 的设备,定制主题将不会生效,不过不必担心,默认样式仍会生效。 +Css 变量 的兼容性要求可以在 [这里](https://caniuse.com/#feat=css-variables) 查看。对于不支持 Css 变量 的设备,定制主题将不会生效,不过不必担心,默认样式仍会生效。 ### 样式变量 @@ -52,7 +52,7 @@ Page({ buttonStyle: ` --button-border-radius: 10px; --button-default-color: green; - ` + `, }, onLoad() { @@ -61,16 +61,16 @@ Page({ buttonStyle: ` --button-border-radius: 2px; --button-default-color: pink; - ` + `, }); }, 2000); - } + }, }); ``` ### 定制多个组件的主题样式 -> 与单个组件的定制方式类似,只需用一个container节点包裹住需要定制的组件,并将 Css变量 设置在container节点上 +> 与单个组件的定制方式类似,只需用一个 container 节点包裹住需要定制的组件,并将 Css 变量 设置在 container 节点上 ```html @@ -88,7 +88,7 @@ import Toast from 'path/to/vant-weapp/dist/toast/toast'; Page({ onClick() { Toast('我是提示文案,建议不超过十五字~'); - } + }, }); ``` @@ -103,7 +103,7 @@ Page({ ### 定制全局主题样式 -> 在 app.wxss 中,写入 Css变量,即可对全局生效 +> 在 app.wxss 中,写入 Css 变量,即可对全局生效 ```less page { @@ -113,4 +113,3 @@ page { --toast-background-color: pink; } ``` - diff --git a/docs/src/App.vue b/docs/src/App.vue index bf933c77..6fc1fd65 100644 --- a/docs/src/App.vue +++ b/docs/src/App.vue @@ -15,19 +15,13 @@ import pkgJson from '../../package.json'; import docConfig, { github, versions } from './doc.config'; -const UNSHARED = [ - 'common', - 'quickstart', - 'changelog', - 'intro', - 'transition' -]; +const UNSHARED = ['common', 'quickstart', 'changelog', 'intro', 'transition']; export default { data() { return { github, - versions + versions, }; }, @@ -40,7 +34,10 @@ export default { let prefix = ''; const { path } = this.$route.meta; - if (location.hostname === '0.0.0.0' || location.hostname === 'localhost') { + if ( + location.hostname === '0.0.0.0' || + location.hostname === 'localhost' + ) { prefix = 'https://youzan.github.io'; } @@ -49,7 +46,7 @@ export default { } return `./preview.html#${path}`; - } + }, }, methods: { @@ -57,15 +54,15 @@ export default { if (version !== pkgJson.version) { location.href = `https://youzan.github.io/vant-weapp/${version}`; } - } - } + }, + }, };