popup docs

This commit is contained in:
cookfront
2017-03-31 16:31:31 +08:00
parent 8a806a7ccf
commit adff0129dc
4 changed files with 180 additions and 50 deletions
+36 -2
View File
@@ -24,7 +24,41 @@ export default {
## Swipe 轮播
### 基础用法
### 使用指南
如果你已经按照[快速上手](/vue/component/quickstart)中引入了整个`ZanUI`,以下**组件注册**就可以忽略了,因为你已经全局注册了`ZanUI`中的全部组件。
#### 全局注册
你可以在全局注册`Swipe`组件,比如页面的主文件(`index.js``main.js`),这样页面任何地方都可以直接使用`Swipe`组件了:
```js
import Vue from 'vue';
import { Swipe, SwipeItem } from '@youzan/zanui-vue';
import '@youzan/zanui-vue/lib/zanui-css/swipe.css';
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
```
#### 局部注册
如果你只是想在某个组件中使用,你可以在对应组件中注册`Swipe`组件,这样只能在你注册的组件中使用`Swipe`
```js
import { Swipe, SwipeItem } from '@youzan/zanui-vue';
export default {
components: {
'zan-swipe': Swipe,
'zam-swipe-item': SwipeItem
}
};
```
### 代码演示
#### 基础用法
:::demo 基础用法
```html
@@ -39,7 +73,7 @@ export default {
```
:::
### 自动轮播
#### 自动轮播
:::demo 自动轮播
```html