Skip to content

v-with fails silently if component has replace: true and more than 1 root element (fiddle included) #701

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
cheapsteak opened this issue Feb 2, 2015 · 1 comment

Comments

@cheapsteak
Copy link
Contributor

The legacy 0.10 docs mentions having only 1 root element as a restriction to replace.
Current version (0.11) seems to have replace: true work for components with multiple root elements, but v-with breaks with no warning.

doesn't work - http://jsfiddle.net/r4h8p5jz/
works - http://jsfiddle.net/r4h8p5jz/1/

var ComponentA = Vue.extend({
    //template: '<div>{{bar}}</div>', // this works
    template: '<div>{{bar}}</div><div></div>', // this doesn't
    replace: true
});

new Vue({
    el: 'body',
    template: '<component-a v-with="bar: foo"></component-a>',
    data: {
        foo: 'Test Test Test Test'
    },
    components: {
        'component-a': ComponentA
    }
});
@yyx990803
Copy link
Member

Thanks, seems to be duplicate of #655

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