Skip to content

Conversation

@time1043
Copy link
Contributor

Motivation

Add documentation for the slots option in Vue Testing Library's render function,
so users know how to provide slot content when rendering components.

Changes

  • Added slots option description under render options.
  • Explained keys and values for slots, with a short example.
  • Linked to Vue Test Utils slots API for reference.

Added documentation for 'slots' option in Vue Testing Library.
@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for testing-library ready!

Name Link
🔨 Latest commit 9e5c6c9
🔍 Latest deploy log https://app.netlify.com/projects/testing-library/deploys/693b6ea3a658ed00080475e1
😎 Deploy Preview https://deploy-preview-1516--testing-library.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

```js
render(MyComponent, {
slots: {
default: 'default content',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add an example with a named slot here please?
I think this would make it clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I’ve updated the PR with an example for a named slot as requested.
The example is based on the documentation from https://test-utils.vuejs.org/api/#slots.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @time1043

@timdeschryver timdeschryver merged commit 26db1f6 into testing-library:main Dec 12, 2025
4 checks passed
@timdeschryver
Copy link
Member

@all-contributors please add @time1043 for docs

@allcontributors
Copy link
Contributor

@timdeschryver

I've put up a pull request to add @time1043! 🎉

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

Successfully merging this pull request may close these issues.

2 participants