When I passing down all prop to child in this way
v-bind="$props"
The parent pass down all props but the child doesn't filter it and if doesn't recognise the props the child print in our html. The result is a dirty and invalid html :(
Vue.component('cc', {
template: `
<div>here is cc
{{y}}
</div>
`,
props: ['y']
});
Vue.component('bb', {
template: `
<div>here is bb
{{x}}
</div>
`,
props: ['x']
});
Vue.component('aa', {
template: `
<div>here is aa
<bb v-bind="$props" :x="'1'"/>
<cc v-bind="$props" />
</div>
`,
props: ['x', 'y']
})
var a = new Vue({
template: `
<div>
<aa :x="x" :y="1"/>
</div>
`,
data(){
return {
x: 0
};
}
});
a.$mount('#app');
<script src="https://unpkg.com/vue"></script>
<div id="app">
</div>
As u see in this example the component bb have this HTML
<div y="1">here is bb 1</div>
and the component cc have
<div x="0">here is cc 1</div>
it's a big problem when I've a lot of props
I know that I can resolve it passing down only the prop that the component need, but with a large app I need to search all my components and add a new prop every time I need to add it. It's so problematic... In the previus version (2.1.10) it works perfectly!