New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate <content select="..."> in favor of <slot name="..."> #1167
Comments
Looks great. How will this behave if you add |
|
I see. So, here:
|
Yes, but |
Could Take a grid component exposing customizable cells. With #1170, one must either name a partial (or component) globally to use it in the cell, or use the grid component as a mixin. The grid template would look like this: <tr v-for="row in rows">
<td v-for="col in columns">
<slot name="cell" scope="local" inherit-assets="true"></slot>
</td>
</tr> Usage: <parent>
<grid>
<div slot="cell">
In {{row}}, {{col}}:
<some-component-from-parent/>
</div>
</grid>
</parent> |
implemented in alpha branch. |
Moved from Discussion#298 for tracking in core.
Problem
Context: https://hacks.mozilla.org/2015/06/the-state-of-web-components/ (See the "Distribution" section)
TL;DR: browser vendors cannot agree on the content distribution API for web components. The current
<content select="xxx">
syntax will likely be replaced.The post describes two possible new APIs: an imperative one and a new declarative one. In Vue this has to do with the internal compilation cycle so we are mostly interested in the new declarative API, the "name slots" proposal from Apple:
Component template:
When using the component:
Rendered result:
The benefits of this proposal over the current
<content>
API, is that it is much more explicit (the exposed "slots" essentially become part of the component's interface), and thus makes it easier to compose nested components:Proposal
Move to the
<slot>
API. It's more explicit than<content>
select. This could co-exist with<content>
in 1.0.0-alpha.The text was updated successfully, but these errors were encountered: