-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
I would like to open a dialog when a user clicks on the avatar component. At the moment the avatar component does not support any actions.
Is there an other was to wrap the avatar component into another component to open a dialog?
This would be nice:
{
"type": "page",
"body": {
"type": "avatar",
"src": "https://suda.cdn.bcebos.com/images/amis/ai-fake-face.jpg",
"hotKey": "command+i,ctrl+i",
"actionType": "dialog",
"dialog": {
"title": "弹框",
"body": "这是个简单的弹框。"
}
}
}
or to be able to add body to an action (preferred solution):
{
"type": "page",
"body": {
"type": "action",
"body": [
{
"type": "avatar",
"src": "https://suda.cdn.bcebos.com/images/amis/ai-fake-face.jpg"
}
],
"actionType": "dialog",
"dialog": {
"title": "弹框",
"body": "这是个简单的弹框。"
}
}
}
The second approach would also support a lot of other usage scenarios, where some would like to add actions to existing components.
Thanks for your consideration.
Metadata
Metadata
Assignees
Labels
No labels