摘要: class A { constructor(name,age ) { 把constructor整体换成: this.name = name; > static name = 'qwe'; this.age = age >static age = 12; } 后得到 say(){ console.lo 阅读全文
posted @ 2020-07-27 19:56 陈小浩 阅读(263) 评论(0) 推荐(0) 编辑
摘要: class A { constructor(name,age) { this.name = name ; this.age = age; } say(){ console.log(this) //指向实例对象 console.log(`I am ${this.name}`) } static sss 阅读全文
posted @ 2020-07-27 17:15 陈小浩 阅读(280) 评论(0) 推荐(0) 编辑
摘要: <body> <div id="box"> </body> <script type="text/javascript"> class A { constructor() { this.box = document.getElementById("box"); //获取父节点 this.img = 阅读全文
posted @ 2020-07-27 17:09 陈小浩 阅读(386) 评论(0) 推荐(0) 编辑