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

Set rules for Elements #27

Open
joeydesitter opened this issue Feb 8, 2022 · 1 comment
Open

Set rules for Elements #27

joeydesitter opened this issue Feb 8, 2022 · 1 comment

Comments

@joeydesitter
Copy link

Do you have any suggestions on how i could set rules for a element?
I have a custom image element, and i want to drag a heading element on top of it, so the heading element is the child of my image element,

i tried setting the isDroppable rule in my craft config but got no luck.

craft: { rules: { isDroppable: true, }, defaultProps: { }

@yoychen
Copy link
Owner

yoychen commented Feb 14, 2022

Hi,

I guess you want to create a Page container element that can have the child elements.

I wish the following steps might help you:

  1. Make sure you have placed a <slot /> in your element's template, which is like this sample.
  2. Use <Canvas component="YourComponent" /> instead of <YourComponent />, which is like this sample.

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