@@ -789,12 +789,16 @@ Parent markup:
789
789
790
790
``` html
791
791
<app-layout >
792
- <h1 slot =" header" >Here might be a page title</h1 >
792
+ <template v-slot:header >
793
+ <h1 >Here might be a page title</h1 >
794
+ </template >
793
795
794
796
<p >A paragraph for the main content.</p >
795
797
<p >And another one.</p >
796
798
797
- <p slot =" footer" >Here's some contact info</p >
799
+ <template v-slot:footer >
800
+ <p >Here's some contact info</p >
801
+ </template >
798
802
</app-layout >
799
803
```
800
804
@@ -860,7 +864,7 @@ Now when we use the `<todo-list>` component, we can optionally define an alterna
860
864
<vue-gwt:import class =" com.mypackage.Todo" />
861
865
<todo-list v-bind:todos =" todos" >
862
866
<!-- Define a variable todo that will get the value of the binded attribute todo -->
863
- <template slot-scope =" { Todo todo }" >
867
+ <template v-slot =" { Todo todo }" >
864
868
<!-- Define a custom template for todo items, using -->
865
869
<!-- `slotProps` to customize each todo. -->
866
870
<span v-if =" todo.isComplete()" >✓</span >
@@ -925,7 +929,7 @@ The API for a Vue component comes in three parts - props, events, and slots:
925
929
926
930
- ** Slots** allow the external environment to compose the component with extra content.
927
931
928
- With the dedicated shorthand syntaxes for ` v-bind ` and ` v-on ` , the intents can be clearly and succinctly conveyed in the template:
932
+ With the dedicated shorthand syntax for ` v-bind ` and ` v-on ` , the intents can be clearly and succinctly conveyed in the template:
929
933
930
934
``` html
931
935
<my-component
@@ -934,8 +938,12 @@ With the dedicated shorthand syntaxes for `v-bind` and `v-on`, the intents can b
934
938
@event-a =" doThis"
935
939
@event-b =" doThat"
936
940
>
937
- <img slot =" icon" src =" ..." >
938
- <p slot =" main-text" >Hello!</p >
941
+ <template v-slot:icon >
942
+ <img src =" ..." >
943
+ </template >
944
+ <template v-slot:main-text >
945
+ <p >Hello!</p >
946
+ </template >
939
947
</my-component >
940
948
```
941
949
0 commit comments