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

Is there anything about slot #1

Open
wssnail opened this issue Aug 4, 2022 · 4 comments
Open

Is there anything about slot #1

wssnail opened this issue Aug 4, 2022 · 4 comments

Comments

@wssnail
Copy link

wssnail commented Aug 4, 2022

Is there anything about the use of slots and the scope of slots

@wssnail wssnail changed the title 有slot相关的内容吗 Is there anything about slot Aug 4, 2022
@dagger8224
Copy link
Owner

dagger8224 commented Aug 4, 2022

Is there anything about the use of slots and the scope of slots

No. "slot" is used to insert custom content in some frameworks such as Vue/Svelte. In dagger.js, you need to put the dynamic content insides the fields of $scope, and render it with "$html" or "$text" directive of the child module. It should be a more general solution than slots.

The slot feature is supported for now, please refer to https://codepen.io/dagger8224/pen/bGKPNwN for the usage of it. Thanks.

@wssnail
Copy link
Author

wssnail commented Aug 4, 2022

Is there anything about the use of slots and the scope of slots

No. "slot" is used to insert custom content in some frameworks such as Vue/Svelte. In dagger.js, you need to put the dynamic content insides the fields of $scope, and render it with "$html" or "$text" directive of the child module. It should be a more general solution than slots.

Encourage component encapsulation?

If the component is encapsulated and for is encapsulated in the sub component, how can the display of a field in the sub component be modified in the parent component

@dagger8224
Copy link
Owner

Is there anything about the use of slots and the scope of slots

No. "slot" is used to insert custom content in some frameworks such as Vue/Svelte. In dagger.js, you need to put the dynamic content insides the fields of $scope, and render it with "$html" or "$text" directive of the child module. It should be a more general solution than slots.

Encourage component encapsulation?

If the component is encapsulated and for is encapsulated in the sub component, how can the display of a field in the sub component be modified in the parent component

Please refer to this demo https://codepen.io/dagger8224/pen/vYdZKgx?editors=1100 to check out what happens if you modified the "message" field in the parent scope.

@dagger8224 dagger8224 reopened this Oct 11, 2023
@dagger8224
Copy link
Owner

@wssnail Since the version 0.9.17 dagger.js supports slot feature already. You may reference to https://codepen.io/dagger8224/pen/bGKPNwN for the usage of slot, thanks for your suggestion.

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