父组件:
子组件:
接受父组件的信息:
向父组件发送事件:
(其中slot是插槽,可以将父组件中的<p>123</p>插入进来,如果父组件没有插入的内容,则显示slot内部的内容)
注意,子组件通过prop接受的参数可以直接在.vue中使用,但是要用在.ts文件中,需要。
但是,如果将接收到的refSchemaId赋值给变量,这样curRefSchemaId = this.refSchemaId;或者curRefSchemaId = this.$props.refSchemas; 都是有问题的,
这样就可以:refSchemaId = this.refSchemaId;curRefSchemaId = this.refSchemaId;