Skip to content

Commit

Permalink
Replaces disclosure-note shortcode with newer note shortcode (#6564)
Browse files Browse the repository at this point in the history
  • Loading branch information
wildmanonline authored Aug 24, 2023
1 parent fba1ccc commit 8bcc006
Show file tree
Hide file tree
Showing 22 changed files with 460 additions and 471 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Ensure you have the following programs and packages installed on your computer:
1. [wordcloud](https://pypi.org/project/wordcloud/) Python package
1. The [Golang](https://golang.org/doc/install) programming language

{{< disclosure-note "Assumptions">}}
{{< note >}}
This guide assumes you have some basic familiarity with the following concepts and skills:

1. Basic programming principles and data structures
1. Are able to read code written in Go, Python, HTML, CSS, and JavaScript
{{</ disclosure-note >}}
{{< /note >}}

## Create Your Data Sets

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,33 +288,33 @@ When loaded in a browser, the page should appear identical to the example in the

On lines 6-8, notice how instead of passing the `title` prop with an argument, we pass it within the component's open and close tags:

```html
```file
<rating-counter v-bind:parent="parentHeader"><h1>Rating 1</h1></rating-counter>
```

On line 20, the slot is referenced with the `<slot></slot>` syntax. As shown in this example, slots support HTML. As well, they have access to the parent’s scope (not demonstrated here), and they even support [nesting more components](#nesting-slots).

{{< disclosure-note "About slot scope" >}}
{{< note type="secondary" title="About slot scope" isCollapsible=true >}}
Slot [scope](https://vuejs.org/v2/guide/components-slots.html#Compilation-Scope) is an important concept to grasp when working with slots. Even though the content you are passing from the parent is intended for the component, you are still within the context of the parent.

For example, trying to access the `count` data of the `rating-counter` component like this would fail:

```html
```file {lang=html}
<rating-counter v-bind:parent="parentHeader">
<h1>{{ count }}</h1>
</rating-counter>
```

However, as you are within the scope of the parent app, you can access the `parentHeader` object (or any other app data):

```html
```file {lang=html}
<rating-counter v-bind:parent="parentHeader">
<h1>{{ parentHeader.label }}</h1>
</rating-counter>
```

Using the `parentHeader.label` string here wouldn't make much sense anyway, so this would only serve to demonstrate the scope concept.
{{< /disclosure-note >}}
{{< /note >}}

### Nesting Slots

Expand Down
Loading

0 comments on commit 8bcc006

Please sign in to comment.