I have two components: component A and Component B. In the component A, I have a props called hasBorder with Boolean type and when i call component A in the component B, I passed value to a props component of component A, I have an error.
html component A:
<div> <img src="path" :style="hasBorder ? 'border:5px;': ''"/></div>
js component A:
Vue.component('compA', {
props: {
hasBorder:{
type:Boolean,
default:false
}
}
});
html component B:
<div> My image : <compA has-border="myStyle"></compA></div>
js component B:
Vue.component('compB', {
data: {
return {
myStyle : { type:Boolean, default :true}
}
}
});
I have this error "Invalid prop:type check failed for prop hasBorder. Expected Boolean, got String with value "myStyle".
How can i fix this error please