无法使用get set 访问器
发布于 6 年前 作者 xiulan76 18120 次浏览 来自 问答

Object.defineProperty(TestPage.prototype, “text”, {        get: function () {            return this.data.text;        },        set: function (text) {            console.log(“text”, text);            this.setData({                text: text            });        },        enumerable: true,        configurable: true    });

当给 text赋值的时候,并不能调用set:function(text){}

回到顶部