write a component by yourself, which is passed to the subcomponent as number, but the result subcomponent receives stringtype
.parent component:
<cmsProgress num=40></cmsProgress>
Sub-component:
<el-progress :text-inside="true" :stroke-width="20" :percentage="num" color="red"></el-progress>
export default {
props:["num"],
data () {
return {
}
},
mounted:function(){
console.log(typeof(this.num)); //string
}
}
what is the reason for this?