Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

怎么保存this (self = this) 是最简单的写法

$
0
0

@jumpchess1 写道:

var self;
cc.Class({

    properties: () => ({
    length: 10,
}),

ctor: function () {
    self = this;
    ...
},

testA: function () {
    self.length = 9;
},

testB: function () {
    self.length = 11;
},
});

是这么写么, 我想把self变成const, 但不知道怎么弄

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>