- Notifications
You must be signed in to change notification settings - Fork275
[docs]: improve slot scope auto exposing "params" behaviour#1924
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
cexbrayat merged 2 commits intovuejs:mainfromrenatodeleao:docs/improve-slot-scope-exposing-docsDec 28, 2022
Merged
[docs]: improve slot scope auto exposing "params" behaviour#1924
cexbrayat merged 2 commits intovuejs:mainfromrenatodeleao:docs/improve-slot-scope-exposing-docsDec 28, 2022
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
https://github.com/vuejs/test-utils/blob/39d86ad5abe71bac8d76c5b82f11f30225cf8673/src/utils/compileSlots.ts#L10The only example provided used an explicit #default="params", but it doesn't mention that if you don't explicitly wrap it, the slot scope becomes also available as params. In VTU1, they were exposed as props, so i think it's better to be explicit about it.
netlifybot commentedDec 27, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview forvue-test-utils-docs ready!
To edit notification comments on pull requests, go to yourNetlify site settings. |
cexbrayat approved these changesDec 28, 2022
Member
cexbrayat left a comment
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.
Thanks@renatodeleao 👍
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
Hello again 👋
I had a bunch of specs that rely on the previous VTU1 behaviour, where slot scope was auto-exposed as a
propsobject for string templates and realised that in VTU2 they are exposed asparamstest-utils/src/utils/compileSlots.ts
Lines 9 to 11 in39d86ad
While VTU1 docsmention that behaviour, VTU2 docsdidn'texplicitly do it as the only example provided used an
<template #scope="params">which doesn't document the implicit behaviour if not providing a wrapping<template>tag.Update both main docs and migration guide, since I believe this is a commonbump in the road while migrating codebases.
As always feel free to edit the writing style and examples to suite the rest of the docs.
Cheers ✌️