js这个 怎么跟 界面的UI对应的

cc.Class({
extends: cc.Component,

properties: {
    label: {
        default: null,
        type: cc.Label
    },
    // defaults, set visually when attaching this script to the Canvas
    text: 'Hello, World',
},

// use this for initialization
onLoad: function () {
    this.label.string = this.text2;
},

// called every frame
update: function (dt) {
  this.label.string = this.text2;
},

});

这个 怎么跟 界面的UI对应的 教程上没写。。。 代码里的label跟界面的UI有联系吗

参考文档说明
https://docs.cocos.com/creator/manual/zh/scripting/class.html#声明属性

1赞

多看看cocos开发文档,里面有新手教程,讲的很详细,还有脚本开发流程