From 5b1e27073deb96c8fffc952857d3cb9f192e16cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 24 Aug 2017 15:07:00 +0800 Subject: [PATCH] Progress: optimzie dom struct --- docs/examples-docs/progress.md | 63 ++++++++++-------------------- packages/progress/index.vue | 53 +++++++------------------ packages/vant-css/src/progress.css | 45 ++++++++++----------- 3 files changed, 55 insertions(+), 106 deletions(-) diff --git a/docs/examples-docs/progress.md b/docs/examples-docs/progress.md index efb9a2993..917183190 100644 --- a/docs/examples-docs/progress.md +++ b/docs/examples-docs/progress.md @@ -1,13 +1,11 @@ - ## Progress 进度条 ### 使用指南 @@ -21,57 +19,37 @@ Vue.component(Progress.name, Progress); #### 基础用法 -默认情况进度条为蓝色,使用`percentage`属性来设置当前进度。 +进度条默认为蓝色,使用`percentage`属性来设置当前进度 :::demo 基础用法 ```html -
- -
-
- -
-
- -
+ + + ``` ::: -#### Inactive +#### 进度条置灰 -是否置灰进度条,一般用于进度条被取消时。 - -:::demo Inactive +:::demo 进度条置灰 ```html -
- -
-
- -
-
- -
+ + + ``` ::: -#### 自定义颜色和文字 +#### 样式定制 可以使用`pivot-text`属性自定义文字,`color`属性自定义进度条颜色 -:::demo 自定义颜色和文字 +:::demo 样式定制 ```html -
- -
-
- -
-
- -
+ + + ``` ::: @@ -79,9 +57,8 @@ Vue.component(Progress.name, Progress); | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| -| inactive | 是否置灰 | `boolean` | `false` | `true`, `false` | -| percentage | 进度百分比 | `number` | `false` | `0-100` | -| pivotText | 文字显示 | `string` | 百分比文字 | - | -| color | 进度条颜色 | `string` | `#38f` | hexvalue | -| textColor | 进度条文字颜色 | `string` | `#fff` | hexvalue | - +| inactive | 是否置灰 | `boolean` | `false` | | +| percentage | 进度百分比 | `number` | `false` | `0-100` | +| pivotText | 文字显示 | `string` | 百分比文字 | - | +| color | 进度条颜色 | `string` | `#38f` | hexvalue | +| textColor | 进度条文字颜色 | `string` | `#fff` | hexvalue | diff --git a/packages/progress/index.vue b/packages/progress/index.vue index 4e89cfd58..685a46135 100644 --- a/packages/progress/index.vue +++ b/packages/progress/index.vue @@ -1,27 +1,11 @@