_testData: string;
get testData(): string {return this._testData}
set testData(data: string) {
this._testData = data;
}
就可以直接 model.testData = 'test'; 设置
console.log(model.testData); 获取
_testData: string;
get testData(): string {return this._testData}
set testData(data: string) {
this._testData = data;
}
就可以直接 model.testData = 'test'; 设置
console.log(model.testData); 获取
本文标题:React Native set get 方法
本文链接:https://www.haomeiwen.com/subject/kmscoxtx.html
网友评论