如何加载预制,并指定自定义属性

cc.Class({
extends: cc.Component,
properties: {
poke:{
default:null,
type:cc.Prefab,
}
},
start () {
// 使用给定的模板在场景中生成一个新节点
var newPoke = cc.instantiate(this.poke);
newPoke.txt = “lalalal”;

    // 将新增的节点添加到 Canvas 节点下面
    this.node.addChild(newPoke);
    // 为星星设置一个随机位置
    newPoke.setPosition(cc.p(100, 0));
},

});

如何创建预制,并设置里边的一个属性,txt属性是我再组件设置之后,挂到预制中,但是无法直接调使用这个属性

要先在node.getComponent( ‘script名稱’ )