feat: 评分 事件&动作

This commit is contained in:
liuzedong02 2022-02-21 16:12:53 +08:00
parent 4b808343c6
commit 508a4d1d8b
2 changed files with 41 additions and 4 deletions

View File

@ -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事件'
}
]
}
}
}
]
}

View File

@ -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);
});
}
}