-
Notifications
You must be signed in to change notification settings - Fork 13
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
docs: add section about slotOptions
in README
#88
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #88 +/- ##
=======================================
Coverage 97.80% 97.80%
=======================================
Files 10 10
Lines 228 228
Branches 58 58
=======================================
Hits 223 223
Misses 4 4
Partials 1 1 ☔ View full report in Codecov by Sentry. |
085a03d
to
a477a7d
Compare
Documents the `slotOptions.mergeProps` option to change the behavior of `PluginSlot` components to merge custom attributes with existing props on widgets.
a477a7d
to
1ccfd07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's awesome to see more documentation like this! One little comment.
``mergeProps`` | ||
'''''''''''''' | ||
|
||
When enabled, this option will merge custom/overridden attributes with existing props passed to the widget, as opposed to passing these attributes to the widget via a ``content`` prop. This is especially useful when using a ``PluginSlot`` to support any custom attributes as well as handle special cases such as merging of custom class names with existing class names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to have a short description of the default (mergeProps: false
) behavior here. I could see someone reading this and thinking, "as opposed to what?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is alluded to in the above "..., as opposed to passing these attributes to the widget via a content
prop.". I suppose this could be more clearly communicated, though 👀
In the README, documents the
slotOptions.mergeProps
option to change the behavior ofPluginSlot
components to merge custom attributes with existing props on widgets.Preview
Also updates existing code blocks to use
javascript
syntax highlighting.