mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 20:04:09 +00:00
[new feature] add Circle component (#608)
This commit is contained in:
69
docs/markdown/en-US/circle.md
Normal file
69
docs/markdown/en-US/circle.md
Normal file
@@ -0,0 +1,69 @@
|
||||
## Circle
|
||||
|
||||
### Install
|
||||
``` javascript
|
||||
import { Circle } from 'vant';
|
||||
|
||||
Vue.use(Circle);
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
#### Basic Usage
|
||||
|
||||
```html
|
||||
<van-circle
|
||||
v-model="currentRate"
|
||||
:rate="30"
|
||||
:speed="100"
|
||||
:text="text"
|
||||
/>
|
||||
```
|
||||
|
||||
``` javascript
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentRate: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
text() {
|
||||
return this.currentRate.toFixed(0) + '%'
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
#### Custom style
|
||||
|
||||
```html
|
||||
<van-circle
|
||||
v-model="currentRate"
|
||||
color="#13ce66"
|
||||
fill="#fff"
|
||||
size="120px"
|
||||
layer-color="#eee"
|
||||
:text="text"
|
||||
:rate="rate"
|
||||
:speed="100"
|
||||
:clockwise="false"
|
||||
:stroke-width="60"
|
||||
/>
|
||||
```
|
||||
|
||||
|
||||
### API
|
||||
|
||||
| Attribute | Description | Type | Default | Accepted Values |
|
||||
|-----------|-----------|-----------|-------------|-------------|
|
||||
| v-model | Current rate | `Number` | - | - |
|
||||
| rate | Target rate | `Number` | `100` | - |
|
||||
| size | Circle size | `String` | `100px` | - |
|
||||
| color | Progress bar color | `String` | `#38f` | - |
|
||||
| layer-color | Layer color | `String` | `#fff` | - |
|
||||
| fill | Fill color | `String` | `none` | - |
|
||||
| speed | Animate speed(rate/s)| `Number` | - | - |
|
||||
| text | Text | `String` | - | - |
|
||||
| stroke-width | Stroke width | `Number` | `40` | - |
|
||||
| clockwise | Is clockwise | `Boolean` | `true` | - |
|
Reference in New Issue
Block a user