Skip to content

Commit b62c049

Browse files
Squashed commit of the following:
commit 5509287 Author: Natalia Tepluhina <[email protected]> Date: Mon May 4 06:57:13 2020 +0300 Options API Reference (#73) * feat: started with Global Config API * feat: finished global config * feat: added component global api * feat: added directives API * feat: added mixin API * feat: add mount API * feat: added unmount and use * Update src/api/global-api.md Co-Authored-By: Jinjiang <[email protected]> * Update src/api/global-config.md Co-Authored-By: Jinjiang <[email protected]> * fixL changed global -> application * fix: fixed types for config * fix: fixed types for API * feat: added a note about native HTML tags * feat: added options data chapter * feat: finished options data * feat: added options-DOM * Added emits to data * feat: added lifecycle hooks * feat: added renderTracked and renderTriggered * feat: added options assets * feat: added options composition * feat: added misc to options * fix: TODO cleanup * fix: changed data description Co-authored-by: Jinjiang <[email protected]> commit b31cbfc Author: Damian Dulisz <[email protected]> Date: Sun May 3 16:18:35 2020 +0200 [Rough Draft] Composition-API: Introduction (#67) * Add Composition-API: Introduction draft * Fix image links * Add styling for Tips and Warnings. Fix missing `js` syntax flag * Apply suggestions from An Phan Co-Authored-By: Phan An <[email protected]> * Apply suggestions from code review Co-Authored-By: Phan An <[email protected]> Co-Authored-By: Rahul Kadyan <[email protected]> * Convert tabs to spaces Co-authored-by: Phan An <[email protected]> Co-authored-by: Rahul Kadyan <[email protected]> commit 19c7285 Author: NataliaTepluhina <[email protected]> Date: Sun May 3 17:18:17 2020 +0300 fix: fixed slots inconsistence
1 parent b7f4d25 commit b62c049

File tree

2 files changed

+547
-4
lines changed

2 files changed

+547
-4
lines changed

src/guide/component-slots.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ app.component('todo-list', {
239239
},
240240
template: `
241241
<ul>
242-
<li v-for="(todo, index) in items" v-bind:key="index">
242+
<li v-for="(item, index) in items">
243243
{{ item }}
244244
</li>
245245
</ul>
@@ -262,7 +262,7 @@ To make `item` available to the slot content provided by the parent, we can add
262262

263263
```html
264264
<ul>
265-
<li v-for="( item, index ) in items" v-bind:key="`${item}-${index}`">
265+
<li v-for="( item, index ) in items">
266266
<slot v-bind:item="item"></slot>
267267
</li>
268268
</ul>
@@ -392,8 +392,10 @@ Similar to `v-on` and `v-bind`, `v-slot` also has a shorthand, replacing everyth
392392
<h1>Here might be a page title</h1>
393393
</template>
394394

395-
<p>A paragraph for the main content.</p>
396-
<p>And another one.</p>
395+
<template #default>
396+
<p>A paragraph for the main content.</p>
397+
<p>And another one.</p>
398+
</template>
397399

398400
<template #footer>
399401
<p>Here's some contact info</p>
@@ -405,6 +407,7 @@ However, just as with other directives, the shorthand is only available when an
405407

406408
```html
407409
<!-- This will trigger a warning -->
410+
408411
<todo-list #="{ item }">
409412
<i class="fas fa-check"></i>
410413
<span class="green">{{ item }}<span>

0 commit comments

Comments
 (0)