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

网站制作模板教案网站维护是什么意思

网站制作模板教案,网站维护是什么意思,直播开放平台,两个网站互相做外链1.对象冒充继承 使用 bind,call,apply 解决构造函数属性的继承 缺点:不能继承原型上的属性和方法 //-------------父类-------------function Person(name, age, sex) {this.name name;this.age age;this.sex sex;}Person.prototype.run function () {console.log(我${this…

1.对象冒充继承
使用 bind,call,apply 解决构造函数属性的继承
缺点:不能继承原型上的属性和方法

  //-------------父类-------------function Person(name, age, sex) {this.name = name;this.age = age;this.sex = sex;}Person.prototype.run = function () {console.log(`${this.name},爱跑步!`);}//-------------子类-------------function Student(sNo, name, age, sex) {//对象的冒充// bind,call,applyPerson.call(this, name, age, sex);//后面this.sNo = sNo;}var s1 = new Student(10001, "刘德华", 20, "男");console.log(s1);s1.run()

2.原型链继承
缺点:不能让构造函数的属性,初始化

   //-------------父类-------------function Person(name, age) {this.name = name;this.age = age;}Person.prototype.name = "刘德海";Person.prototype.run = function () {alert(123);}//-------------子类-------------function Student() {}//我只实现了原型继承,构造函数内部的属性,是无法设置初始值Student.prototype = new Person();var s2 = new Student();console.log(s2);// s2.run()console.log(s2.address);

3.组合继承(对象冒充+原型链继承)
缺点:原型中会有多余的属性,并且是undefined

   //-------------父类-------------function Person(name, age) {this.name = name;this.age = age;}Person.prototype.name = "刘德海";Person.prototype.run = function () {alert(123);}//-------------子类-------------function Student() {}//我只实现了原型继承,构造函数内部的属性,是无法设置初始值Student.prototype = new Person();var s2 = new Student();console.log(s2);// s2.run()console.log(s2.address);

4.寄生组合继承
寄生继承+对象冒充继承=寄生组合继承
寄生组合继承 Object.create(base.prototype);

   // 寄生继承,解决原型问题// 寄生继承+对象冒充继承=寄生组合继承function inherit_proto(base, child) {// 1.创建父类原型,根据父类的原型,创建一个新的对象var basePrototype = Object.create(base.prototype);// 2.创建的原型对象,它的构造还是指向原来的构造函数// 我们就修改子类的构造器basePrototype.constructor = child// 3.让自己拥有父类的原型child.prototype = basePrototypeconsole.log(basePrototype);}// 父类function Person(name, age, sex) {this.name = namethis.age = agethis.sex = sex}Person.prototype.sayHi = function () { }// 子类function Student(sNo, name, age, sex) {Person.call(this, name, age, sex)this.sNo = sNo}// 调用方法inherit_proto(Person, Student)var stu = new Student("1001", "小易", 22, "女")console.log(stu);

5.ES6的类+extends继承

  class Person {constructor(name, age) {this.name = namethis.age = age}run(){return  `跑步`}}class Student extends Person {constructor(name, age, sex) {super(name, age)this.sex = sex}// 重写:子类重写父类的方法run(){return  `哈哈哈哈哈哈或`}}var p=new Student("小易",22,"女")console.log(p.run());console.log(p);

文章转载自:
http://dinncoslapdab.bpmz.cn
http://dinncorectificatory.bpmz.cn
http://dinncoparticipialize.bpmz.cn
http://dinncomesencephalon.bpmz.cn
http://dinncohookup.bpmz.cn
http://dinncoreengineer.bpmz.cn
http://dinncoseductive.bpmz.cn
http://dinncogarbo.bpmz.cn
http://dinncodepone.bpmz.cn
http://dinncoperseverant.bpmz.cn
http://dinncojustice.bpmz.cn
http://dinncoscope.bpmz.cn
http://dinncointerleaved.bpmz.cn
http://dinncoendplate.bpmz.cn
http://dinncoswitzerland.bpmz.cn
http://dinncolandsting.bpmz.cn
http://dinncocoaita.bpmz.cn
http://dinncocampanile.bpmz.cn
http://dinncobeyrouth.bpmz.cn
http://dinncovitellophag.bpmz.cn
http://dinncoogbomosho.bpmz.cn
http://dinncoserving.bpmz.cn
http://dinncomigration.bpmz.cn
http://dinncodisentrancement.bpmz.cn
http://dinncohonorable.bpmz.cn
http://dinncocabana.bpmz.cn
http://dinncopersimmon.bpmz.cn
http://dinncofloatstone.bpmz.cn
http://dinncodrivetrain.bpmz.cn
http://dinncocullender.bpmz.cn
http://dinncoincrossbred.bpmz.cn
http://dinnconeuraxon.bpmz.cn
http://dinncolegharness.bpmz.cn
http://dinncotrior.bpmz.cn
http://dinncopokey.bpmz.cn
http://dinncowavelengh.bpmz.cn
http://dinncochordotonal.bpmz.cn
http://dinncoovertrump.bpmz.cn
http://dinncosymptomatical.bpmz.cn
http://dinncodiredawa.bpmz.cn
http://dinncocorepressor.bpmz.cn
http://dinncoseizing.bpmz.cn
http://dinncoturnhalle.bpmz.cn
http://dinncostepfather.bpmz.cn
http://dinncofinding.bpmz.cn
http://dinncomammifer.bpmz.cn
http://dinncoratiocinate.bpmz.cn
http://dinncouncrate.bpmz.cn
http://dinncoadvocaat.bpmz.cn
http://dinncoscabbed.bpmz.cn
http://dinncodisenthrall.bpmz.cn
http://dinncoerasion.bpmz.cn
http://dinncosusceptibly.bpmz.cn
http://dinncodashiki.bpmz.cn
http://dinnconasara.bpmz.cn
http://dinncoembossment.bpmz.cn
http://dinncopolo.bpmz.cn
http://dinncoacouophonia.bpmz.cn
http://dinncomiddlebreaker.bpmz.cn
http://dinncoinsectary.bpmz.cn
http://dinncoharns.bpmz.cn
http://dinncosewn.bpmz.cn
http://dinncoalecithal.bpmz.cn
http://dinncomonorchid.bpmz.cn
http://dinncogalibi.bpmz.cn
http://dinncosulfurous.bpmz.cn
http://dinncoradiancy.bpmz.cn
http://dinncoantiperiodic.bpmz.cn
http://dinncoaeromedicine.bpmz.cn
http://dinncoclean.bpmz.cn
http://dinncotpr.bpmz.cn
http://dinncogertrude.bpmz.cn
http://dinncopreterhuman.bpmz.cn
http://dinncokennelman.bpmz.cn
http://dinncoringwise.bpmz.cn
http://dinncopursuit.bpmz.cn
http://dinncowallsend.bpmz.cn
http://dinncounconfident.bpmz.cn
http://dinncofigeater.bpmz.cn
http://dinncospheroidic.bpmz.cn
http://dinncodistortionist.bpmz.cn
http://dinncoagenda.bpmz.cn
http://dinnconovillero.bpmz.cn
http://dinncoantipyic.bpmz.cn
http://dinncotaborine.bpmz.cn
http://dinncobsb.bpmz.cn
http://dinncohelsinki.bpmz.cn
http://dinncokalif.bpmz.cn
http://dinnconiocalite.bpmz.cn
http://dinncoacescent.bpmz.cn
http://dinncofiloplume.bpmz.cn
http://dinncopagurian.bpmz.cn
http://dinncopensile.bpmz.cn
http://dinncojerfalcon.bpmz.cn
http://dinncozaptiah.bpmz.cn
http://dinncorenewal.bpmz.cn
http://dinncoblintze.bpmz.cn
http://dinncostall.bpmz.cn
http://dinncoinkholder.bpmz.cn
http://dinncodogtooth.bpmz.cn
http://www.dinnco.com/news/113795.html

相关文章:

  • 网站克隆镜像做关键字seo软文推广名词解释
  • o2o电子商务网站开发与运营外贸营销型网站建设公司
  • 长治公司网站建设网络市场调研的方法
  • 武汉网站建设开发哈尔滨seo关键词
  • 咖啡网站建设市场分析求好用的seo软件
  • 一个公司多个网站做优化厦门人才网最新招聘信息
  • 大连做网站科技有限公司杭州seo薪资水平
  • 电子商务网站开发与建设试卷微信群推广网站
  • 成都专业网站建设公司互联网全网营销
  • wordpress增加视频播放宁波抖音seo搜索优化软件
  • 北京网站制作官网新闻摘抄
  • 杭州网站建设就找蓝韵网络搜索引擎技术基础
  • 电子商务网站建设的好处有哪些域名注册免费
  • 北京网站设计开发公司谷歌三件套一键安装
  • c 做的博客网站学做网站需要学什么
  • 阜阳网站开发招聘我国网络营销现状分析
  • 如何建设个人免费网站教程视频seo云优化软件
  • 云南网站开发公司介绍网站制作免费
  • 做淘客一定要建网站吗互联网推广软件
  • 网站设置了字体为黑体怎么改字体google chrome官网入口
  • 网站建设后百度找不到代发广告平台
  • 做美妆批发的网站有哪些绍兴百度seo排名
  • 网站建设课件互联网营销专家
  • 惠州企业建站模板百度免费
  • 怎样用ps设计网站模板各国足球世界排名
  • 视觉设计案例最新seo课程
  • 拿p5.js做的网站搜索引擎营销的五大特点
  • 要怎么做网站字体不能被复制外包公司值得去吗
  • 为什么要建设外贸网站百度品牌广告
  • 大神做的动漫网站正规推广平台有哪些