code review

This commit is contained in:
cookfront
2017-03-30 21:22:14 +08:00
parent e241d92cd9
commit e20022b868
20 changed files with 522 additions and 186 deletions
+45 -5
View File
@@ -12,7 +12,41 @@
## Progress 进度条
### 基础用法
### 使用指南
如果你已经按照[快速上手](/vue/component/quickstart)中引入了整个`ZanUI`,以下**组件注册**就可以忽略了,因为你已经全局注册了`ZanUI`中的全部组件。
#### 全局注册
你可以在全局注册`Progress`组件,比如页面的主文件(`index.js``main.js`),这样页面任何地方都可以直接使用`Progress`组件了:
```js
import Vue from 'vue';
import { Progress } from '@youzan/zanui-vue';
import '@youzan/zanui-vue/lib/zanui-css/progress.css';
Vue.component(Progress.name, Progress);
```
#### 局部注册
如果你只是想在某个组件中使用,你可以在对应组件中注册`Progress`组件,这样只能在你注册的组件中使用`Progress`
```js
import { Progress } from '@youzan/zanui-vue';
export default {
components: {
'zan-progress': Progress
}
};
```
### 代码演示
#### 基础用法
默认情况进度条为蓝色,使用`percentage`属性来设置当前进度。
:::demo 基础用法
```html
@@ -29,7 +63,10 @@
:::
### Inactive
#### Inactive
是否置灰进度条,一般用于进度条被取消时。
:::demo Inactive
```html
<div class="demo-progress__wrapper">
@@ -45,8 +82,11 @@
:::
### 自定义颜色和文字
:::demo 自定义颜色
#### 自定义颜色和文字
可以使用`pivot-text`属性自定义文字,`color`属性自定义进度条颜色
:::demo 自定义颜色和文字
```html
<div class="demo-progress__wrapper">
<zan-progress class="demo-progress__demo1" pivot-text="红色" color="#ed5050" :percentage="26"></zan-progress>
@@ -64,7 +104,7 @@
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
| inactive | 是否只会 | `boolean` | `false` | `true`, `false` |
| inactive | 是否置灰 | `boolean` | `false` | `true`, `false` |
| percentage | 进度百分比 | `number` | `false` | `0-100` |
| pivotText | 文字显示 | `string` | 百分比文字 | - |
| color | 进度条颜色 | `string` | `#38f` | hexvalue |