Skip to content

[v0.11] Multiple insertion points -> undesired behavior? #531

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

Closed
agonbina opened this issue Nov 1, 2014 · 4 comments
Closed

[v0.11] Multiple insertion points -> undesired behavior? #531

agonbina opened this issue Nov 1, 2014 · 4 comments

Comments

@agonbina
Copy link

agonbina commented Nov 1, 2014

It seems like whenever there is two or more <content> tags inside a Component template, you must either replace all of them or else the original will not show for those selectors for which no replacement is specified.

Consider the following Component template:

<div class="ui active progress">
   <content select="div.bar">
       <div class="bar" v-style="width: progress + '%'">
           <div class="progress">{{progress}}%</div>
       </div>
   </content>
   <content select="div.label">
       <div class="label">Uploading files</div>
   </content>
</div>

After I properly register the component using Vue.component('ui-progress', definition) and attempt this:

<ui-progress>
    <div class="label">Transcoding video...</div>
</ui-progress>

Here the div.bar block disappears because I did not provide a replacement for it instead of falling back to the div.bar markup specified in the original template. Can you please confirm if this the desired behavior? Imo it would make sense only the selectors for which a replacement is specified to be changed and the original template to remain intact for the rest of the <content> pieces.

Would be happy to prepare a jsfiddle if you need me to!

Best,
Agon

p.s. I'm working with Vue 0.11-rc3 if that makes any difference.

@agonbina agonbina changed the title Multiple insertion points -> undesired behavior? [v0.11] Multiple insertion points -> undesired behavior? Nov 1, 2014
@yyx990803
Copy link
Member

Hmm yeah this seems to be a bug. A jsfiddle would be helpful.

@agonbina
Copy link
Author

agonbina commented Nov 1, 2014

Here it is: http://jsfiddle.net/gonigkum/b8bryfvw/3/

@yyx990803
Copy link
Member

Should be fixed now, thanks!

@agonbina
Copy link
Author

agonbina commented Nov 3, 2014

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants