File tree Expand file tree Collapse file tree 4 files changed +63
-5
lines changed
Expand file tree Collapse file tree 4 files changed +63
-5
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,29 @@ cat.changeAge(7)
135135 point . toString ( )
136136
137137 // JavaScript继承
138+ // 原型prototype机制或apply和call方法去实现较简单,建议使用构造函数与原型混合方式。
139+
140+ function Per ( ) {
141+ this . name = 'Wang'
142+ }
143+
144+ function Child ( ) {
145+ this . age = 13
146+ }
147+
148+ Child . prototype = new Per ( ) ; //通过原型,继承Per
149+
150+ var demo = new Child ( )
151+ console . log ( demo . name )
152+ console . log ( demo . age )
138153
139154 // 构造函数绑定:使用call或apply方法,将父对象的构造函数绑定在子对象上
140155
141- function Dog ( name , color ) {
142- Animal . apply ( this , arguments )
143- this . name = name
144- this . color = color
145- }
156+ function Parent ( ) {
157+ this . name = "parent"
158+ }
159+
160+ function Children ( ) {
161+ Parent . call ( this )
162+ this . type = "children" ;
163+ }
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ ______
6161
6262+ ECMAScript(核心):JavaScript语言基础
6363+ DOM(Document Object Model,文档对象模型):规定了访问HTML和XML的接口
64+ * DOM事件模型:冒泡金和捕获
65+ * 事件流:捕获阶段->目标阶段->冒泡阶段
66+
67+
6468+ BOM(浏览器对象模型):提供了浏览器窗口之间进行交互的对象和方法
6569
6670##### 介绍JavaScript的原型,原型链?有什么特点
@@ -177,8 +181,34 @@ var n = str.split("o");
177181
178182Vue生命周期
179183
184+ #### Vue的三要素
185+
186+ + 响应式
187+ + 模板引擎
188+ + 渲染
189+
190+ ***
191+
192+ Web
193+
194+ ### 1. Web标准三方面
195+
196+ + 结构标准(HTML): 用于对网页元素进行整理和分类
197+ + 表现标准(CSS): 用于设置网页元素的版式、颜色、大小等外观样式
198+ + 行为标准(JS): 定义页面的交互和行为
199+
200+ ### 2. Web前端三方面
201+
202+ + HTML:超文本标记语言
203+ + CSS:层叠样式
204+ + JS:交互的角度描述页面行为
180205
181206
182207
208+ HTML
209+ + 两个标记 . 和 .. 分表代表当前目录和上一层目录。
183210
211+ #### 定义列表` <dl> `
212+ + ` <dt> ` :列表的标题,这个标签是必须的
213+ + ` <dl> ` :列表的列表项,如果不需要它,可以不加
184214
Original file line number Diff line number Diff line change @@ -62,3 +62,11 @@ function hander(obj){
6262}
6363
6464console . log ( hander ( obj ) )
65+
66+
67+ var arr = [ 1 , 2 , 3 ]
68+ for ( let i = 0 ; i < arr . length ; i ++ ) {
69+ setTimeout ( function ( ) {
70+ console . log ( i )
71+ } , 3000 )
72+ }
Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ fn = function (x){
118118*/
119119
120120// 闭包表示包括不被计算的变量的函数,也就是说函数可以使用函数之外定义的变量
121+
122+ // 闭包的作用:间接访问一个变量
121123var sMessage = 'hello world'
122124
123125function sayHello ( ) {
You can’t perform that action at this time.
0 commit comments