mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Rate): count can be string
This commit is contained in:
parent
e0cbe958a3
commit
ad6087770d
@ -111,7 +111,7 @@ export default {
|
|||||||
| Attribute | Description | Type | Default |
|
| Attribute | Description | Type | Default |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| v-model | Current rate | *number* | - |
|
| v-model | Current rate | *number* | - |
|
||||||
| count | Count | *number* | `5` |
|
| count | Count | *number \| string* | `5` |
|
||||||
| size | Icon size| *number \| string* | `20px` |
|
| size | Icon size| *number \| string* | `20px` |
|
||||||
| gutter | Icon gutter | *number \| string* | `4px` |
|
| gutter | Icon gutter | *number \| string* | `4px` |
|
||||||
| color | Selected color | *string* | `#ffd21e` |
|
| color | Selected color | *string* | `#ffd21e` |
|
||||||
|
@ -111,7 +111,7 @@ export default {
|
|||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| v-model | 当前分值 | *number* | - |
|
| v-model | 当前分值 | *number* | - |
|
||||||
| count | 图标总数 | *number* | `5` |
|
| count | 图标总数 | *number \| string* | `5` |
|
||||||
| size | 图标大小,默认单位为`px` | *number \| string* | `20px` |
|
| size | 图标大小,默认单位为`px` | *number \| string* | `20px` |
|
||||||
| gutter | 图标间距,默认单位为`px` | *number \| string* | `4px` |
|
| gutter | 图标间距,默认单位为`px` | *number \| string* | `4px` |
|
||||||
| color | 选中时的颜色 | *string* | `#ffd21e` |
|
| color | 选中时的颜色 | *string* | `#ffd21e` |
|
||||||
|
@ -42,7 +42,7 @@ export default createComponent({
|
|||||||
default: 'star-o',
|
default: 'star-o',
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
type: Number,
|
type: [Number, String],
|
||||||
default: 5,
|
default: 5,
|
||||||
},
|
},
|
||||||
touchable: {
|
touchable: {
|
||||||
@ -146,7 +146,7 @@ export default createComponent({
|
|||||||
const isVoid = status === 'void';
|
const isVoid = status === 'void';
|
||||||
|
|
||||||
let style;
|
let style;
|
||||||
if (this.gutterWithUnit && score !== count) {
|
if (this.gutterWithUnit && score !== +count) {
|
||||||
style = { paddingRight: this.gutterWithUnit };
|
style = { paddingRight: this.gutterWithUnit };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user