mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
feat: 评分 事件&动作
This commit is contained in:
parent
4b808343c6
commit
508a4d1d8b
@ -14,7 +14,7 @@ export default {
|
||||
debug: true,
|
||||
body: [
|
||||
{
|
||||
name: "input-rating",
|
||||
name: "input-rating-clear",
|
||||
type: "action",
|
||||
label: 'clear触发器',
|
||||
level: 'primary',
|
||||
@ -23,7 +23,7 @@ export default {
|
||||
actions: [
|
||||
{
|
||||
actionType: 'clear',
|
||||
componentId: 'clear-input-rating-receiver',
|
||||
componentId: 'clear-input-rating-clear-receiver',
|
||||
description: '点击清空内容'
|
||||
}
|
||||
]
|
||||
@ -31,8 +31,8 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'rate',
|
||||
id: 'clear-input-rating-receiver',
|
||||
name: 'rate-clear',
|
||||
id: 'clear-input-rating-clear-receiver',
|
||||
type: 'input-rating',
|
||||
value: 3,
|
||||
onEvent: {
|
||||
@ -46,6 +46,41 @@ export default {
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "input-rating-reset",
|
||||
type: "action",
|
||||
label: 'reset触发器',
|
||||
level: 'primary',
|
||||
onEvent: {
|
||||
click: {
|
||||
actions: [
|
||||
{
|
||||
actionType: 'clear',
|
||||
componentId: 'clear-input-rating-reset-receiver',
|
||||
description: '点击清空内容'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'rate-reset',
|
||||
id: 'clear-input-rating-reset-receiver',
|
||||
type: 'input-rating',
|
||||
value: 3,
|
||||
resetValue: 3,
|
||||
onEvent: {
|
||||
change: {
|
||||
actions: [
|
||||
{
|
||||
actionType: 'toast',
|
||||
msgType: 'info',
|
||||
msg: '派发change事件'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -105,6 +105,8 @@ export class Rating extends React.Component<RatingProps, any> {
|
||||
at: Math.floor(props.value),
|
||||
hidden: props.half && props.value % 1 < 0.5
|
||||
}
|
||||
}, () => {
|
||||
this.getShowColorAndText(props.value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user