Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for an example using props #1

Open
endafarrell opened this issue Sep 20, 2023 · 1 comment
Open

Request for an example using props #1

endafarrell opened this issue Sep 20, 2023 · 1 comment

Comments

@endafarrell
Copy link

Hi!

I would like an example of where the ContextMenu is given props which in turn are show in an item. My use case is that I would like to attach your show to a div and pass in some this-div-specific values so that the context menu can show this info.

Something like:

show(originalEvent, {id: MAP_CONTEXTMENU_ID, props: {"payload": "element1"}});

However, though I can see in the docs and examples the use of props with values lala and 1, I can't figure out how to use them.

Any help would be much appreciated.

@xhofe
Copy link
Owner

xhofe commented Sep 25, 2023

Currently, we can only get props through Item's onClick, like this:
https://github.com/alist-org/alist-web/blob/5f72ca8bcc8bdb0c1f83913ae3b9f22e0a67531f/src/pages/home/folder/context-menu.tsx#L56
But it cannot be used directly in the children of Item. I can add this feature later if you need to use props in the Item's children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants