🌐 AI搜索 & 代理 主页
Skip to content

Commit e6acc3a

Browse files
authored
chore(docs): minor updates to the carousel docs (#3964)
1 parent ca1b5de commit e6acc3a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/components/carousel/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,36 @@ Set the prop `indicators` to show the slide indicator buttons.
136136

137137
Both indicators and controls can be set at the same time or independently.
138138

139+
## Carousel slide content
140+
141+
`b-carousel-slide` provides several props and slots for placing content in the slide.
142+
143+
### Props
144+
145+
- `caption` Text to use as the main title on the slide (placed inside the inner element which has
146+
the class `carousel-caption`)
147+
- `text` Textual placed under the title (placed inside the inner element which has the class
148+
`carousel-caption`)
149+
- `img-src` URL of image to be placed into the background of the slide
150+
- `caption-html` Alternate prop to the `caption` prop, which supports HTML strings
151+
- `html` Alternate prop to the `text` prop, which supports HTML strings
152+
153+
<p class="alert alert-danger">
154+
<strong>Warning:</strong> Be cautious of using the <code>caption-html</code> and <code>html</code>
155+
props to display user supplied content, as it may make your application vulnerable to
156+
<a class="alert-link" href="https://en.wikipedia.org/wiki/Cross-site_scripting">
157+
<abbr title="Cross Site Scripting Attacks">XSS attacks</abbr></a>, if you do not first
158+
<a class="alert-link" href="https://en.wikipedia.org/wiki/HTML_sanitization">sanitize</a> the
159+
user supplied string.
160+
</p>
161+
162+
### Named slots
163+
164+
- `default` content that will be placed inside of the inner element which has the class
165+
`carousel-caption`. Appears after any content from the `caption` and `text` props.
166+
- `img` content to place into the background of the slide. Despite the slot's name, you can place
167+
almost any content in this slot in lieu of using the `default` slot or `caption` and `text` props.
168+
139169
## Carousel animation
140170

141171
Carousel, by default, uses a sliding animation. You can change the slide animation to a cross-fade

0 commit comments

Comments
 (0)