比如有一个脚本挂在主场景上是这样:

const {ccclass, property} = cc._decorator;
@ccclass
export default class RadioButton extends cc.Component{
target: string;:6:
onLoad(){
}
}
另一个脚本挂在主场景上是这样:
import RadioButton from './RadioButton';
type rb = RadioButton;
const {ccclass, property} = cc._decorator;
@ccclass
export default class RadioButton extends cc.Component{
aaa: rb;
onLoad(){
this.aaa = this.node.getComponent('RadioButton');
主要就在这里了提示类型错误,因为getComponent返回的是cc.Node类型,aaa是上衣个脚本的类型,所以提示cc.Node上没有target属性,但是getComponent(‘RadioButton’)按理说应该就是rb类型才对啊,请问怎么做类型转换,别说都转成any类型啊,那样智能提示都没有了
}
}

