diff --git a/src/progress/README.md b/src/progress/README.md index 5309cdc0d..554712646 100644 --- a/src/progress/README.md +++ b/src/progress/README.md @@ -19,6 +19,11 @@ Use 'percentage' prop to set current progress ``` +### Stroke Width + +```html + +``` ### Inactive @@ -60,6 +65,7 @@ Use `pivot-text` to custom text,use `color` to custom bar color |------|------|------|------|------| | inactive | Whether to be gray | *boolean* | `false` | - | | percentage | Percentage | *number* | `0` | - | +| stroke-width | Stroke width | *string \| number* | `4px` | 2.2.1 | | show-pivot | Whether to show text | *boolean* | `true` | - | | color | Color | *string* | `#1989fa` | - | | pivot-text | Text | *string* | percentage | - | diff --git a/src/progress/README.zh-CN.md b/src/progress/README.zh-CN.md index 8d9c6122c..6b20f6470 100644 --- a/src/progress/README.zh-CN.md +++ b/src/progress/README.zh-CN.md @@ -19,8 +19,18 @@ Vue.use(Progress); ``` +### 线条粗细 + +通过`stroke-width`可以设置进度条的粗细 + +```html + +``` + ### 置灰 +设置`inactive`属性后进度条将置灰 + ```html ``` @@ -58,6 +68,7 @@ Vue.use(Progress); |------|------|------|------|------| | inactive | 是否置灰 | *boolean* | `false` | - | | percentage | 进度百分比 | *number* | `0` | - | +| stroke-width | 进度条粗细,默认单位为`px` | *string \| number* | `4px` | 2.2.1 | | show-pivot | 是否显示进度文字 | *boolean* | `true` | - | | color | 进度条颜色 | *string* | `#1989fa` | - | | text-color | 进度条文字颜色 | *string* | `#fff` | - | diff --git a/src/progress/demo/index.vue b/src/progress/demo/index.vue index 32007759f..a1be706e2 100644 --- a/src/progress/demo/index.vue +++ b/src/progress/demo/index.vue @@ -4,24 +4,17 @@ + + + + - + - - + + +
{showPivot && ( diff --git a/src/progress/test/__snapshots__/demo.spec.js.snap b/src/progress/test/__snapshots__/demo.spec.js.snap index 2883cf0ef..87ba7f9bb 100644 --- a/src/progress/test/__snapshots__/demo.spec.js.snap +++ b/src/progress/test/__snapshots__/demo.spec.js.snap @@ -5,6 +5,9 @@ exports[`renders demo correctly 1`] = `
50%
+
+
50%
+
50%
diff --git a/src/progress/test/index.spec.js b/src/progress/test/index.spec.js index a55ae65b8..69cfbb4e8 100644 --- a/src/progress/test/index.spec.js +++ b/src/progress/test/index.spec.js @@ -1,16 +1,18 @@ import Progress from '..'; -import { mount } from '../../../test/utils'; +import { mount, later } from '../../../test/utils'; -test('calc width', () => { +test('calc width', async () => { const wrapper = mount(Progress, { propsData: { showPivot: false, percentage: 100 } }); + await later(); expect(wrapper).toMatchSnapshot(); wrapper.vm.showPivot = true; wrapper.vm.pivotText = 'test'; + await later(); expect(wrapper).toMatchSnapshot(); });