父组件的编写
<a:orgCode=orgCode ></a>
在data里面增加orgCode。
-
data() {
-
return {
-
orgCode: '037',
-
},
-
};
-
},
子组件编写
子组件通过prop接收
-
props: {
-
orgCode: {
-
type: String,
-
default: null,
-
},
-
},
子组件使用
子组件可以通过this.orgCode进行使用。
评论(0)