-
-
Save yyx990803/971e31b08b928c7886dde797291e59ec to your computer and use it in GitHub Desktop.
<SomeComponent> | |
<template #header> | |
<div>Header message</div> | |
</template> | |
<template #item="{ item }"> | |
<div class="item">{{ item.text }}</div> | |
</template> | |
<template #footer> | |
<div>Footer message</div> | |
</template> | |
</SomeComponent> |
It is an optional syntax. Please read the linked RFCs.
I guessed at the wrapper being a div id=“header” as this is what is used for href anchor.
@slot:header ?
quite nice as long it can be applied to a simple div or p too
I felt that this looks more like a ref=“header” as commonly use ID to identify something, like with the $refs is to identity something
Had a feeling it was for slots. Liked the (version)={ more }.
My initial thoughts that it was object destructing and that all the key values in header would be binded as attribute property.
On seconds thoughs reading the purpose I think # clashes with css for id.
Maybe something like a ^
hat symbol be better because its pointing to something outside the component.
<SomeComponent>
<template ^header>
<div>Header message</div>
</template>
<template ^item="{ item }">
<div class="item">{{ item.text }}</div>
</template>
<template ^footer>
<div>Footer message</div>
</template>
</SomeComponent>
how about <template &foo>
?
& symbol often used as meaning reference
in other language. :)
how about
<template &foo>
?
& symbol often used as meaningreference
in other language. :)
👍
FYI - please don't discuss alternatives here, Gist doesn't have comment notifications and this is NOT the RFC itself.
Alternative symbols have been extensively discussed in the RFC threads and comments here are unlikely to be considered.
If you have strong opinions, participate in the discussions in the rfcs repo instead.
Looks great , guessed it right away. The # is good because it is associated with id. this will be a great shorthand addition
Awesome
I agree with @cristijora