From 39dd8c70a19b7f2ec8526db338cdd6ad7f92c4d4 Mon Sep 17 00:00:00 2001 From: alexchexes Date: Mon, 9 Dec 2024 11:23:08 +0000 Subject: [PATCH] docs(guide/components/slots): clarify slot presence phrasing (#3124) * docs(guide/components/slots): clarify slot presence phrasing The original phrasing "whether or not a slot is present" was potentially misleading, as it suggested checking the existence of the slot itself rather than whether content was passed to it. Updated the explanation to clarify this distinction for better readability and accuracy. * docs(guide/components/slots): clarify slot presence phrasing (2) The phrase "When the header/footer/default is present..." could be interpreted as referring to the slot's definition, rather than whether content is provided for the slot --- src/guide/components/slots.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guide/components/slots.md b/src/guide/components/slots.md index d3dfe83771..b50855cdf6 100644 --- a/src/guide/components/slots.md +++ b/src/guide/components/slots.md @@ -298,12 +298,12 @@ function BaseLayout(slots) { ## Conditional Slots {#conditional-slots} -Sometimes you want to render something based on whether or not a slot is present. +Sometimes you want to render something based on whether or not content has been passed to a slot. You can use the [$slots](/api/component-instance.html#slots) property in combination with a [v-if](/guide/essentials/conditional.html#v-if) to achieve this. In the example below we define a Card component with three conditional slots: `header`, `footer` and the `default` one. -When the header / footer / default is present we want to wrap them to provide additional styling: +When content for the header / footer / default is present, we want to wrap it to provide additional styling: ```vue-html