diff --git a/src/circle/README.md b/src/circle/README.md index 6ea277773..291b624e7 100644 --- a/src/circle/README.md +++ b/src/circle/README.md @@ -131,6 +131,7 @@ How to use: [Custom Theme](#/en-US/theme). | Name | Default Value | Description | | ------------------------ | ------------------- | ----------- | +| @circle-size | `100px` | - | | @circle-color | `@blue` | - | | @circle-layer-color | `@white` | - | | @circle-text-color | `@text-color` | - | diff --git a/src/circle/README.zh-CN.md b/src/circle/README.zh-CN.md index a56b88eb7..09c505eb4 100644 --- a/src/circle/README.zh-CN.md +++ b/src/circle/README.zh-CN.md @@ -142,6 +142,7 @@ export default { | 名称 | 默认值 | 描述 | | ------------------------ | ------------------- | ---- | +| @circle-size | `100px` | - | | @circle-color | `@blue` | - | | @circle-layer-color | `@white` | - | | @circle-text-color | `@text-color` | - | diff --git a/src/circle/index.js b/src/circle/index.js index d77c7af95..2f1764fa6 100644 --- a/src/circle/index.js +++ b/src/circle/index.js @@ -21,6 +21,7 @@ function getPath(clockwise, viewBoxSize) { export default createComponent({ props: { text: String, + size: [Number, String], color: [String, Object], layerColor: String, strokeLinecap: String, @@ -32,10 +33,6 @@ export default createComponent({ type: [Number, String], default: 0, }, - size: { - type: [Number, String], - default: 100, - }, fill: { type: String, default: 'none', diff --git a/src/circle/index.less b/src/circle/index.less index 40f51e015..0613d8159 100644 --- a/src/circle/index.less +++ b/src/circle/index.less @@ -3,6 +3,8 @@ .van-circle { position: relative; display: inline-block; + width: @circle-size; + height: @circle-size; text-align: center; svg { diff --git a/src/circle/test/__snapshots__/demo.spec.js.snap b/src/circle/test/__snapshots__/demo.spec.js.snap index 2512dab4e..58fc6e132 100644 --- a/src/circle/test/__snapshots__/demo.spec.js.snap +++ b/src/circle/test/__snapshots__/demo.spec.js.snap @@ -3,7 +3,7 @@ exports[`renders demo correctly 1`] = `