docs(QuickStart): adjust quick start (#2939)

This commit is contained in:
rex 2020-04-01 15:41:07 +08:00 committed by GitHub
parent 141996b35e
commit 92de5e9e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 82 additions and 73 deletions

View File

@ -31,13 +31,16 @@ npm i vant-weapp -S --production
如果你使用 typescript 开发小程序,需要在 tsconfig.json 中增加如下配置,防止 npm 构建后 tsc 编译报错
请将`path/to/node_modules/@vant/weapp`修改为项目中 @vant/weapp 所在的目录
```json
{
"baseUrl": ".",
"paths": {
"@vant/weapp/*": ["./node_modules/@vant/weapp/dist/*"]
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@vant/weapp/*": ["path/to/node_modules/@vant/weapp/dist/*"]
}
}
...
}
```
@ -59,21 +62,27 @@ npm i vant-weapp -S --production
以 Button 组件为例,只需要在`app.json``index.json`中配置 Button 对应的路径即可。如果你是通过下载源代码的方式使用 @vant/weapp,请将路径修改为项目中 @vant/weapp 所在的目录。
```json
// 通过 npm 安装
// app.json
"usingComponents": {
"van-button": "@vant/weapp/button"
"van-button": "@vant/weapp/button/index"
}
```
```json
// 通过下载源码使用
// 通过下载源码使用 es6版本
// app.json
"usingComponents": {
"van-button": "path/to/@vant/weapp/dist/button"
"van-button": "path/to/@vant/weapp/dist/button/index"
}
```
```json
// 通过下载源码使用 es5版本
// app.json
"usingComponents": {
"van-button": "path/to/@vant/weapp/lib/button/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-action-sheet": "path/to/@vant/weapp/dist/action-sheet/index"
"van-action-sheet": "@vant/weapp/action-sheet/index"
}
```
@ -191,7 +191,7 @@ Page({
| disabled | 是否为禁用状态 | *boolean* | - |
| className | 为对应列添加额外的 class 类名 | *string* | - |
| openType | 微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | *string* | - |
| lang | 指定返回用户信息的语言zh_CN 简体中文zh_TW 繁体中文en 英文 | *string* | `en` |
| lang | 指定返回用户信息的语言zh_CN 简体中文zh_TW 繁体中文en 英文 | *string* | `en` |
| sessionFrom | 会话来源openType="contact"时有效 | *string* | - |
| sendMessageTitle | 会话内消息卡片标题openType="contact"时有效 | *string* | 当前标题 |
| sendMessagePath | 会话内消息卡片点击跳转小程序路径openType="contact"时有效 | *string* | 当前分享路径 |

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-area": "path/to/@vant/weapp/dist/area/index"
"van-area": "@vant/weapp/area/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-button": "path/to/@vant/weapp/dist/button/index"
"van-button": "@vant/weapp/button/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-calendar": "path/to/@vant/weapp/dist/calendar/index"
"van-calendar": "@vant/weapp/calendar/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-card": "path/to/@vant/weapp/dist/card/index"
"van-card": "@vant/weapp/card/index"
}
```

View File

@ -6,8 +6,8 @@
```json
"usingComponents": {
"van-cell": "path/to/@vant/weapp/dist/cell/index",
"van-cell-group": "path/to/@vant/weapp/dist/cell-group/index"
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index"
}
```

View File

@ -5,8 +5,8 @@
```json
"usingComponents": {
"van-checkbox": "path/to/@vant/weapp/dist/checkbox/index",
"van-checkbox-group": "path/to/@vant/weapp/dist/checkbox-group/index"
"van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-circle": "path/to/@vant/weapp/dist/circle/index"
"van-circle": "@vant/weapp/circle/index"
}
```

View File

@ -10,8 +10,8 @@ Layout 提供了`van-row`和`van-col`两个组件来进行行列布局
```json
"usingComponents": {
"van-row": "path/to/@vant/weapp/dist/row/index",
"van-col": "path/to/@vant/weapp/dist/col/index"
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index"
}
```

View File

@ -5,8 +5,8 @@
```json
"usingComponents": {
"van-collapse": "path/to/@vant/weapp/dist/collapse/index",
"van-collapse-item": "path/to/@vant/weapp/dist/collapse-item/index"
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index"
}
```

View File

@ -9,7 +9,7 @@ Vant 中默认包含了一些常用样式,可以直接通过 className 的方
在 app.wxss 中引入内置样式
```css
@import "path/to/@vant/weapp/dist/common/index.wxss";
@import "@vant/weapp/common/index.wxss";
```
## 代码演示

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-count-down": "path/to/@vant/weapp/dist/count-down/index"
"van-count-down": "@vant/weapp/count-down/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-datetime-picker": "path/to/@vant/weapp/dist/datetime-picker/index"
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
}
```

View File

@ -12,7 +12,7 @@
```json
"usingComponents": {
"van-dialog": "path/to/@vant/weapp/dist/dialog/index"
"van-dialog": "@vant/weapp/dialog/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-divider": "path/to/@vant/weapp/dist/divider/index"
"van-divider": "@vant/weapp/divider/index"
}
```

View File

@ -6,8 +6,8 @@
```json
"usingComponents": {
"van-dropdown-menu": "path/to/@vant/weapp/dist/dropdown-menu/index",
"van-dropdown-item": "path/to/@vant/weapp/dist/dropdown-item/index"
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-field": "path/to/@vant/weapp/dist/field/index"
"van-field": "@vant/weapp/field/index"
}
```

View File

@ -6,9 +6,9 @@
```json
"usingComponents": {
"van-goods-action": "path/to/@vant/weapp/dist/goods-action/index",
"van-goods-action-icon": "path/to/@vant/weapp/dist/goods-action-icon/index",
"van-goods-action-button": "path/to/@vant/weapp/dist/goods-action-button/index"
"van-goods-action": "@vant/weapp/goods-action/index",
"van-goods-action-icon": "@vant/weapp/goods-action-icon/index",
"van-goods-action-button": "@vant/weapp/goods-action-button/index"
}
```

View File

@ -10,8 +10,8 @@
```json
"usingComponents": {
"van-grid": "path/to/@vant/weapp/dist/grid/index",
"van-grid-item": "path/to/@vant/weapp/dist/grid-item/index"
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-icon": "path/to/@vant/weapp/dist/icon/index"
"van-icon": "@vant/weapp/icon/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-image": "path/to/@vant/weapp/dist/image/index"
"van-image": "@vant/weapp/image/index"
}
```

View File

@ -6,8 +6,8 @@
```json
"usingComponents": {
"van-index-bar": "path/to/@vant/weapp/dist/index-bar/index",
"van-index-anchor": "path/to/@vant/weapp/dist/index-anchor/index"
"van-index-bar": "@vant/weapp/index-bar/index",
"van-index-anchor": "@vant/weapp/index-anchor/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-loading": "path/to/@vant/weapp/dist/loading/index"
"van-loading": "@vant/weapp/loading/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-nav-bar": "path/to/@vant/weapp/dist/nav-bar/index"
"van-nav-bar": "@vant/weapp/nav-bar/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-notice-bar": "path/to/@vant/weapp/dist/notice-bar/index"
"van-notice-bar": "@vant/weapp/notice-bar/index"
}
```

View File

@ -5,7 +5,7 @@
```json
"usingComponents": {
"van-notify": "path/to/@vant/weapp/dist/notify/index"
"van-notify": "@vant/weapp/notify/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-overlay": "path/to/@vant/weapp/dist/overlay/index"
"van-overlay": "@vant/weapp/overlay/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-panel": "path/to/@vant/weapp/dist/panel/index"
"van-panel": "@vant/weapp/panel/index"
}
```

View File

@ -9,7 +9,7 @@
```json
"usingComponents": {
"van-picker": "path/to/@vant/weapp/dist/picker/index"
"van-picker": "@vant/weapp/picker/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-popup": "path/to/@vant/weapp/dist/popup/index"
"van-popup": "@vant/weapp/popup/index"
}
```

View File

@ -5,7 +5,7 @@
```json
"usingComponents": {
"van-progress": "path/to/@vant/weapp/dist/progress/index"
"van-progress": "@vant/weapp/progress/index"
}
```

View File

@ -6,8 +6,8 @@
```json
"usingComponents": {
"van-radio": "path/to/@vant/weapp/dist/radio/index",
"van-radio-group": "path/to/@vant/weapp/dist/radio-group/index"
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-rate": "path/to/@vant/weapp/dist/rate/index"
"van-rate": "@vant/weapp/rate/index"
}
```
## 代码演示

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-search": "path/to/@vant/weapp/dist/search/index"
"van-search": "@vant/weapp/search/index"
}
```

View File

@ -6,8 +6,8 @@
```json
"usingComponents": {
"van-sidebar": "path/to/@vant/weapp/dist/sidebar/index",
"van-sidebar-item": "path/to/@vant/weapp/dist/sidebar-item/index"
"van-sidebar": "@vant/weapp/sidebar/index",
"van-sidebar-item": "@vant/weapp/sidebar-item/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-skeleton": "path/to/@vant/weapp/dist/skeleton/index"
"van-skeleton": "@vant/weapp/skeleton/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-slider": "path/to/@vant/weapp/dist/slider/index"
"van-slider": "@vant/weapp/slider/index"
}
```

View File

@ -10,7 +10,7 @@
```json
"usingComponents": {
"van-stepper": "path/to/@vant/weapp/dist/stepper/index"
"van-stepper": "@vant/weapp/stepper/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-steps": "path/to/@vant/weapp/dist/steps/index"
"van-steps": "@vant/weapp/steps/index"
}
```

View File

@ -10,7 +10,7 @@ Sticky 组件与 CSS 中`position: sticky`属性实现的效果一致,当组
```json
"usingComponents": {
"van-sticky": "path/to/@vant/weapp/dist/sticky/index"
"van-sticky": "@vant/weapp/sticky/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-submit-bar": "path/to/@vant/weapp/dist/submit-bar/index"
"van-submit-bar": "@vant/weapp/submit-bar/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-swipe-cell": "path/to/@vant/weapp/dist/swipe-cell/index"
"van-swipe-cell": "@vant/weapp/swipe-cell/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-switch": "path/to/@vant/weapp/dist/switch/index"
"van-switch": "@vant/weapp/switch/index"
}
```

View File

@ -6,8 +6,8 @@
```json
"usingComponents": {
"van-tab": "path/to/@vant/weapp/dist/tab/index",
"van-tabs": "path/to/@vant/weapp/dist/tabs/index"
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
}
```

View File

@ -6,8 +6,8 @@
```json
"usingComponents": {
"van-tabbar": "path/to/@vant/weapp/dist/tabbar/index",
"van-tabbar-item": "path/to/@vant/weapp/dist/tabbar-item/index"
"van-tabbar": "@vant/weapp/tabbar/index",
"van-tabbar-item": "@vant/weapp/tabbar-item/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-tag": "path/to/@vant/weapp/dist/tag/index"
"van-tag": "@vant/weapp/tag/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-toast": "path/to/@vant/weapp/dist/toast/index"
"van-toast": "@vant/weapp/toast/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-transition": "path/to/@vant/weapp/dist/transition/index"
"van-transition": "@vant/weapp/transition/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-tree-select": "path/to/@vant/weapp/dist/tree-select/index"
"van-tree-select": "@vant/weapp/tree-select/index"
}
```

View File

@ -6,7 +6,7 @@
```json
"usingComponents": {
"van-uploader": "path/to/@vant/weapp/dist/uploader/index"
"van-uploader": "@vant/weapp/uploader/index"
}
```