-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Vue3: Use slot value directly if it's a string in source decorator #23784
Conversation
0ec0e0e is an opinionated commit. Happy to drop it if it's not relevant to the project. |
It is relevant, however i guess we already have this let me checkout your PR and get back to you |
The CI seems to fail, please let me know if I need to do anything. Not sure what to do with:
|
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.
good call. i did not handle this case previous cause we were supposed to pass a function only
@yannbf Do you still want to look at how to test this PR? |
What I did
Support plain text for "slot" controls.
Currently, only functions
() => "Default Text Content"
, VNodeh("p", "Default Text Content")
, and stringified objects are supported.and even if we do use those supported ways, the control table will display something like
But I want users to be able to change the slot content, if it's only a label, so if the slot content is a string, we just render that instead.
ALSO, without this change, if you use a String slot content, on the "Show Code" block, you'll only see an empty template tag.
How to test
yarn task --task sandbox --start-from auto --template vue3-vite/default-ts
Checklist
I don't know where to write tests, the slot function isn't tested anywhere.
I don't think it is documented anywhere, but if I missed it, please let me know.
MIGRATION.MD
Maintainers
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]
🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>