2.0.5
https://jsfiddle.net/leopoldthecuber/Lnzcwvy3/1/
Run the demo
Nothing is displayed
A red 'false' is displayed
This has something to do with the inline style style="color: red" on <my-component>. Remove it and the problem goes away.
I found that v-show can not be used for the root element. Just:
Vue.component('my-component', {
props: {
visible: false
},
template: `
<div><div v-show="visible">
<span>{{visible}} - {{typeof visible}}</span>
</div></div>
`
});
var App = Vue.extend();
new App({
el: '#app',
data() {
return {
visible: false
}
},
template: `
<div>
<my-component :visible="visible" style="color: red"></my-component>
</div>
`
})
is working.
already fixed with this PR https://github.com/vuejs/vue/pull/4138
Most helpful comment
already fixed with this PR https://github.com/vuejs/vue/pull/4138