Merge branch 'master' of gitlab.qima-inc.com:fe/zanui-vue

This commit is contained in:
niunai
2017-03-28 14:43:57 +08:00
9 changed files with 125 additions and 44 deletions

View File

@@ -53,13 +53,6 @@
</zan-col>
</zan-row>
</example-block><example-block title="button group">
<div class="button-group">
<zan-button type="primary" size="small">确认付款</zan-button>
<zan-button size="small">确认收货</zan-button>
<zan-button size="small">取消订单</zan-button>
</div>
</example-block></section></template>
<style>
@component-namespace demo {

View File

@@ -9,7 +9,7 @@
</zan-swipe>
</example-block><example-block title="自动轮播">
<zan-swipe :auto-play="true">
<zan-swipe :auto-play="true" @pagechange:end="handlePageEnd">
<zan-swipe-item>
<img src="https://img.yzcdn.cn/upload_files/2017/03/14/FmTPs0SeyQaAOSK1rRe1sL8RcwSY.jpeg?imageView2/2/w/980/h/980/q/75/format/webp" alt="">
</zan-swipe-item>
@@ -33,4 +33,12 @@
}
</style>
<script>
import Vue from "vue";import ExampleBlock from "../components/example-block";Vue.component("example-block", ExampleBlock);</script>
import Vue from "vue";import ExampleBlock from "../components/example-block";Vue.component("example-block", ExampleBlock);
export default {
methods: {
handlePageEnd(page, index) {
console.log(page, index);
}
}
};
</script>

View File

@@ -40,6 +40,7 @@
</div>
<div class="demo-progress__wrapper">
<zan-progress class="demo-progress__demo1" :inactive="true" :percentage="100"></zan-progress>
</div>
```
:::
@@ -47,7 +48,6 @@
### 自定义颜色和文字
:::demo 自定义颜色
```html
</div>
<div class="demo-progress__wrapper">
<zan-progress class="demo-progress__demo1" pivot-text="红色" color="#ed5050" :percentage="26"></zan-progress>
</div>

View File

@@ -12,6 +12,16 @@
}
</style>
<script>
export default {
methods: {
handlePageEnd(page, index) {
console.log(page, index);
}
}
};
</script>
## Swipe 轮播
### 基础用法
@@ -33,7 +43,7 @@
:::demo 自动轮播
```html
<zan-swipe :auto-play="true">
<zan-swipe :auto-play="true" @pagechange:end="handlePageEnd">
<zan-swipe-item>
<img src="https://img.yzcdn.cn/upload_files/2017/03/14/FmTPs0SeyQaAOSK1rRe1sL8RcwSY.jpeg?imageView2/2/w/980/h/980/q/75/format/webp" alt="">
</zan-swipe-item>
@@ -43,3 +53,16 @@
</zan-swipe>
```
:::
### API
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
| autoPlay | 是否自动轮播 | `boolean` | `false` | `true`, `false` |
| showIndicators | 是否显示指示器 | `boolean` | `true` | `true`, `false` |
### 事件
| 事件名 | 说明 | 参数 |
|-----------|-----------|-----------|
| `pagechange:end` | 每一页轮播结束后触发 | `(elem, currIndex)``elem`为触发页当前的DOM节点 |

View File

@@ -25,7 +25,7 @@ Vue.component('footer-nav', FooterNav);
let routesConfig = routes(navConfig);
routesConfig.push({
path: '/',
redirect: '/component/button'
redirect: '/component/install'
});
const router = new VueRouter({
@@ -38,8 +38,10 @@ router.beforeEach((route, redirect, next) => {
if (route.path !== '/') {
window.scrollTo(0, 0);
}
const pathname = process.env.NODE_ENV === 'production' ? '/vue/' : '/';
if (isMobile()) {
window.location.replace(location.pathname + 'examples.html#' + route.path);
window.location.replace(pathname + 'examples.html#/');
return;
}
document.title = route.meta.title || document.title;