Added v-cloak and v-slot content on Vue roadmap (#7161)
* Add v-cloak description Added v-cloak content in Vue roadmap * Add v-slot description Added v-slot content in Vue roadmappull/7171/head
parent
61c4d566c2
commit
4183871a75
2 changed files with 46 additions and 2 deletions
@ -1 +1,22 @@ |
||||
# v-cloak |
||||
# v-cloak |
||||
|
||||
The v-cloak directive is used to prevent the uncompiled Vue template from being visible while the Vue instance is still loading. It temporarily hides the content until Vue has finished compiling the template |
||||
|
||||
The v-cloak directive remains until the component instance is mounted. |
||||
```vue |
||||
<div v-cloak> |
||||
{{ message }} |
||||
</div> |
||||
``` |
||||
|
||||
Combined with CSS, you can hide elements with v-cloak until they are ready. |
||||
```css |
||||
[v-cloak] { |
||||
display: none; |
||||
} |
||||
``` |
||||
The `<div>` will not be visible until the compilation is done. |
||||
|
||||
Visit the following resources to learn more: |
||||
|
||||
- [@official@v-cloak documentation](https://vuejs.org/api/built-in-directives.html#v-cloak) |
||||
|
@ -1 +1,24 @@ |
||||
# v-slot |
||||
# v-slot |
||||
|
||||
The v-slot directive to define slots in components, allowing you to pass and render content dynamically inside a component. |
||||
|
||||
For named slots, you use v-slot with a specific slot name. This lets you pass different content to different parts of a component: |
||||
|
||||
```vue |
||||
<template> |
||||
<custom-component> |
||||
<template v-slot:header> |
||||
<h1>Header Content</h1> |
||||
</template> |
||||
<template v-slot:footer> |
||||
<p>Footer Content</p> |
||||
</template> |
||||
</custom-component> |
||||
</template> |
||||
``` |
||||
|
||||
The shorthand for `v-slot` is `#`, for example `v-slot:header` becomes `#header`. |
||||
|
||||
Visit the following resources to learn more: |
||||
|
||||
- [@official@v-slot documentation](https://vuejs.org/api/built-in-directives.html#v-slot) |
||||
|
Loading…
Reference in new issue