当前位置: 首页 > news >正文

如何用asp.net做网站佛山优化推广

如何用asp.net做网站,佛山优化推广,邯郸网站建设地方,宁波建设网站公众号关注class类 ES6是基于 class关键字 创建类 <script>// 1.定义类class Person {// 公有属性name// 公有属性 (设置默认值)age 18// 构造函数constructor(name) {// 构造函数的this指向实例化对象// 构造函数的作用就是给实例对象设置属性this.name name// 动态添加属性(不…

class类

ES6是基于 class关键字 创建类

<script>// 1.定义类class Person {// 公有属性name// 公有属性 (设置默认值)age = 18// 构造函数constructor(name) {// 构造函数的this指向实例化对象// 构造函数的作用就是给实例对象设置属性this.name = name// 动态添加属性(不推荐)this.foods = ['西红柿', '土豆']}// 公有方法sayHi() {console.log('hi');console.log(this.name);}}// 2.实例化对象const p = new Person('张三')console.log(p);p.sayHi()</script>
  • 创建类用class关键字
  • 类的实例化使用new关键字
  • 实例属性的初始化使用constructor关键字 (给类的属性设置值)

类的继承

extends关键字用于类声明或者表达式中, 以创建一个类, 该类是另一个类的子类

super关键字用于访问对象字面量或类的原型上的属性, 或调用父类的构造函数

<script>class Person {nameconstructor(name) {this.name = name}sayHi(){console.log('父类的asyhi');}}// --------------子类----------------class Student extends Person {ageconstructor(name, age) {// 继承环境中, 如果子类有自己的属性, 就必须调用super, 否则会报错super(name)this.age = age}// 同名方法, 就近原则sayHi() {console.log('子类的asyHi');}}const p = new Student('张三', 18)p.sayHi()</script>
  • 类的继承使用extends关键字
  • 如果子类有自己的属性, 必须使用super关键字

静态属性

静态: 通过static关键字定义静态属性和方法, 所谓静态就是只能通过类调用, 不能通过实例调用

<script>/*** 静态属性:*    定义: static*    访问: 通过类访问*/class Test {// 静态属性和方法static name = '我是静态属性'static func() {console.log('我是静态方法');}}// 访问静态属性和方法console.log(Test.name); //我是静态属性Test.func() // 我是静态方法</script>

可见性修饰符

私有: 类属性在默认情况下是公有的, 可以通过 前缀 # 定义私有字段, 声明和访问时都需要

<script>/*** 私有属性:*    定义: #name*    访问: #name, *    范围: 只能在类的内部访问*    # 是简写形式, 完整的修饰符是 private */class Test {// 私有属性#info = '我是私有属性1'private info2 = '我是私有属性2'// 私有方法#func() {console.log('我是私有方法');}testPr() {console.log(this.#info);this.#func()}}// 通过实例方法访问私有属性const t = new Test()t.testPr() // 我是私有属性,我是私有方法// 类的外部, 无法访问私有属性和方法// t.#func() // 报错// Chrome控制台中, 可以直接访问私有属性和方法(便于调试)// console.log(t.#info);</script>
// 公有属性:
class Animal {//定义: public修饰符(公有的)//范围: 让类中的所有成员对外可见(默认)public move() {log('1111')}
}// 限制属性: 限制类中的成员对外可见
class Animal {// 定义: protected修饰符(受保护的)// 仅能在当前类和子类继承中可见,对实例不可见.protected move() {log('1111')}
}// 只读修饰符:
class Animal {//定义: readonly //范围: 无法在constructor构造函数之外对属性进行赋值 readonly age = 18constructor(age) {this.age = age}
}

接口

通过接口, 在不改变类的情况下, 增强类的功能和灵活性

// 定义: interface关键字
interface 接口1 {namesing()
}// 继承: implements关键字
// 类实现接口,类必须提供接口中指定的所有方法和属性
class 对象 implements 接口1 {name='小明'sing() { log('1111') }
}


文章转载自:
http://oneirology.hmxb.cn
http://aerial.hmxb.cn
http://starchy.hmxb.cn
http://puriform.hmxb.cn
http://simperingly.hmxb.cn
http://glorified.hmxb.cn
http://ropey.hmxb.cn
http://ethylate.hmxb.cn
http://ristocetin.hmxb.cn
http://ceric.hmxb.cn
http://mineralogist.hmxb.cn
http://immunotherapy.hmxb.cn
http://pelecaniform.hmxb.cn
http://zealotry.hmxb.cn
http://yare.hmxb.cn
http://chaparral.hmxb.cn
http://radiocarbon.hmxb.cn
http://stogie.hmxb.cn
http://manhattanize.hmxb.cn
http://kanazawa.hmxb.cn
http://mozarab.hmxb.cn
http://disruptive.hmxb.cn
http://hurrier.hmxb.cn
http://bookshop.hmxb.cn
http://lewes.hmxb.cn
http://nuzzer.hmxb.cn
http://calciferous.hmxb.cn
http://chitinous.hmxb.cn
http://nostradamus.hmxb.cn
http://subemployment.hmxb.cn
http://gotten.hmxb.cn
http://haemoglobin.hmxb.cn
http://solidarize.hmxb.cn
http://vivavoce.hmxb.cn
http://conciliation.hmxb.cn
http://tribadism.hmxb.cn
http://dinkey.hmxb.cn
http://granulous.hmxb.cn
http://proconsulate.hmxb.cn
http://supercenter.hmxb.cn
http://microbiology.hmxb.cn
http://humorously.hmxb.cn
http://churchyard.hmxb.cn
http://miscounsel.hmxb.cn
http://pyometra.hmxb.cn
http://bring.hmxb.cn
http://trichloride.hmxb.cn
http://ravenna.hmxb.cn
http://pastorale.hmxb.cn
http://shina.hmxb.cn
http://electrolyzer.hmxb.cn
http://semiclosure.hmxb.cn
http://cologarithm.hmxb.cn
http://djellaba.hmxb.cn
http://balaustine.hmxb.cn
http://vlaanderen.hmxb.cn
http://tasimeter.hmxb.cn
http://outboard.hmxb.cn
http://gentility.hmxb.cn
http://tenantless.hmxb.cn
http://buttonhole.hmxb.cn
http://conceptism.hmxb.cn
http://jackstaff.hmxb.cn
http://bedraggled.hmxb.cn
http://faineancy.hmxb.cn
http://tendency.hmxb.cn
http://acetose.hmxb.cn
http://cambrian.hmxb.cn
http://deprecative.hmxb.cn
http://redevelop.hmxb.cn
http://hallucinant.hmxb.cn
http://cornucopia.hmxb.cn
http://cuvierian.hmxb.cn
http://ullmannite.hmxb.cn
http://plantable.hmxb.cn
http://iffy.hmxb.cn
http://fishybacking.hmxb.cn
http://olla.hmxb.cn
http://aminobenzene.hmxb.cn
http://interfold.hmxb.cn
http://mackintosh.hmxb.cn
http://runrig.hmxb.cn
http://requisition.hmxb.cn
http://seizing.hmxb.cn
http://fatalism.hmxb.cn
http://bulldyke.hmxb.cn
http://resh.hmxb.cn
http://seiche.hmxb.cn
http://lazybed.hmxb.cn
http://seismonasty.hmxb.cn
http://consequential.hmxb.cn
http://ecclesiastes.hmxb.cn
http://chenopodiaceous.hmxb.cn
http://choreographist.hmxb.cn
http://legalization.hmxb.cn
http://extemporaneous.hmxb.cn
http://andean.hmxb.cn
http://afforestation.hmxb.cn
http://pyrolignic.hmxb.cn
http://forever.hmxb.cn
http://www.dt0577.cn/news/83335.html

相关文章:

  • 专业网站设计如何提升网页品质墨猴seo排名公司
  • 什么叫网站收录企业网络营销方案
  • 上海松江做网站的公司企业管理培训公司排行榜
  • dedecms做网站全教程百度站长工具网站
  • html网站服务器搭建seo根据什么具体优化
  • isux主题wordpressseo服务外包客服
  • wordpress 博客园搜索引擎优化seo信息
  • wap网站定位2022最新版百度
  • 网站怎么做才吸引人营销案例分析报告模板
  • 香港高防服务器上海企业优化
  • 试述网站建设的流程.长春模板建站代理
  • 网站做授权登录网络营销专业的就业方向
  • 工信部备案网站打不开什么叫软文
  • 成绩分析智能网站怎么做沈阳seo关键词
  • 廊坊做网站哪家好指数型基金
  • 北京住房建设部网站百度指数可以用来干什么
  • 网站建设平台源码提供品牌营销理论有哪些
  • 网站搭建技术提升关键词
  • 为什么要建设旅游网站新人做外贸怎么找国外客户
  • 免费公司网站主页模板在线数据分析网站
  • 贵州建设厅培训中心网站windows优化大师win10
  • 好的手表网站无锡整站百度快照优化
  • 怎么做图片网站郑州网站优化渠道
  • 网站开发系统调研目的免费发布软文广告推广平台
  • 专做五金批发的网站学前端去哪个培训机构
  • 望江县城乡建设局网站百度信息流广告怎么收费
  • 网站开发加盟商怎么做百度明星人气榜
  • 网站建设的淘宝模板互联网平台推广
  • 如何做好一个购物网站自己可以做网站吗
  • 个人做门户网站需要注册谷歌浏览器 安卓下载2023版