ts get和set

class User { // get、set方法的成员变量命名时建议在前面加 _ private _fullName: string; //get 的用法 get fullName(): string{ return this._fullName; } // "set" 访问器必须正好具有一个参数
posted @ 2022-08-24 21:01  明媚下雨天  阅读(651)  评论(0编辑  收藏  举报