[Doc] Dialog: update usage (#1520)

This commit is contained in:
neverland 2018-07-21 10:09:17 +08:00 committed by GitHub
parent 4a12659b14
commit e5f252944a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,8 @@
```js ```js
import { Dialog } from 'vant'; import { Dialog } from 'vant';
Vue.use(Dialog);
``` ```
### Usage ### Usage

View File

@ -5,6 +5,8 @@ Dialog 组件支持函数调用和组件调用两种形式
```js ```js
import { Dialog } from 'vant'; import { Dialog } from 'vant';
Vue.use(Dialog);
``` ```
### 代码演示 ### 代码演示
@ -83,7 +85,7 @@ export default {
#### 高级用法 #### 高级用法
如果需要在弹窗内实现更复杂的交互,可以通过组件形式来调用 Dialog 如果需要在弹窗内实现更复杂的交互,可以通过组件形式来调用 Dialog,调用前需要通过 Vue.use 注册组件
```html ```html
<van-dialog <van-dialog
@ -106,8 +108,6 @@ export default {
``` ```
```js ```js
Vue.use(Dialog);
export default { export default {
data() { data() {
return { return {