Skip to content

Commit dfd41b4

Browse files
committed
doc: props
1 parent 3c41697 commit dfd41b4

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,24 @@ const model = ref<number>(0)
4646
| max | number | maximum value | 100 | |
4747
| step | number | step | 1 | |
4848
| addable | boolean | can add data. This will emit 'addThumb' | false | |
49-
| limit | number | the limit can be add | 0 | |
49+
| limit | number | the limit can be add | undefined | |
5050
| smooth | boolean | with smooth off, the thumb will only show on the stop point | false | |
5151
| deduplicate | boolean | can the thumb be duplicated | true | |
5252
| rangeHighlight | boolean | highlight range between min and max. This will only effect while modelValue is array and length is 2 | false | |
53-
| showStops | boolean \| number | whether to show dots on the track | 12 | |
53+
| showStops | boolean \| number | whether to show dots on the track. When set to number, will only show dots while stops less than the value | 12 | |
54+
| size | 'small' \| 'medium' \| 'large' | track size | 'small' | |
55+
| thumbType | 'circle' \| 'square' \| 'rect' | thumb type(default 'rect' while size is 'large', otherwise 'small') | 'circle' \| 'rect' | |
56+
| thumbSize | 'small' \| 'medium' \| 'large' | thumb size | 'medium' | |
5457
| renderTop | Function | render function on the top of thumb | undefined | |
58+
| renderTopOnActive | boolean | only render top function on the active thumb | false | |
5559
| renderBottom | Function | render bottom function on the bottom of thumb | undefined | |
60+
| renderBottomOnActive | boolean | only render bottom function on the active thumb | false | |
5661

5762
## events
5863

59-
| Name | Description |
60-
| --- | --- |
61-
| add | add a thumb |
64+
| Name | Type| Description |
65+
| --- | --- | --- |
66+
| add | (value: number): void | add event while click the track |
6267

6368
## types
6469

@@ -74,11 +79,6 @@ export interface RangeData<T = unknown> {
7479
export type RangeValue<T = unknown> = number | number[] | RangeData<T>[]
7580
```
7681
77-
## TODO
78-
79-
- [ ] style convenience(track height/thumb style)
80-
- [ ] only render on active
81-
8282
## License
8383
8484
[MIT](./LICENSE) License © 2023-PRESENT [wiidede](https://github.com/wiidede)

src/Range.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const props = withDefaults(defineProps<{
3131
deduplicate: true,
3232
showStops: 12,
3333
size: 'small',
34-
thumbType: 'circle',
3534
thumbSize: 'medium',
3635
})
3736
@@ -234,7 +233,7 @@ provide(RangeContainerRefKey, containerRef)
234233
:render-bottom="model[index].renderBottom || renderBottom"
235234
:render-bottom-on-active="renderBottomOnActive"
236235
:addable="addable"
237-
:thumb-type="thumbType"
236+
:thumb-type="thumbType || (size === 'large' ? 'rect' : 'circle')"
238237
:thumb-size="thumbSize"
239238
@move-done="current = -1"
240239
@update="onUpdate"

0 commit comments

Comments
 (0)