8000 Sync names for child component. (#279) · mitar/vuejs.org@e684f3f · GitHub
[go: up one dir, main page]

Skip to c 8000 ontent

Commit e684f3f

Browse files
mitaryyx990803
authored andcommitted
Sync names for child component. (vuejs#279)
1 parent a52c120 commit e684f3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/guide/components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@ To make the composition work, we need a way to interweave the parent "content" a
549549
Before we dig into the API, let's first clarify which scope the contents are compiled in. Imagine a template like this:
550550

551551
``` html
552-
<child>
552+
<child-component>
553553
{{ msg }}
554-
</child>
554+
</child-component>
555555
```
556556

557557
Should the `msg` be bound to the parent's data or the child data? The answer is parent. A simple rule of thumb for component scope is:
@@ -562,7 +562,7 @@ A common mistake is trying to bind a directive to a child property/method in the
562562

563563
``` html
564564
<!-- does NOT work -->
565-
<child v-show="someChildProperty"></child>
565+
<child-component v-show="someChildProperty"></child-component>
566566
```
567567

568568
Assuming `someChildProperty` is a property on the child component, the example above would not work as intended. The parent's template should not be aware of the state of a child component.

0 commit comments

Comments
 (0)
0