摘要: 闭包定义 在JavaScript中,当一个内部函数被其外部函数之外的变量引用时,就形成了一个闭包。简单说,闭包就是能够读取其他函数内部变量的函数。 闭包简单应用 例一: function a() { var i = 0; function b() { console.log(++i); } retu 阅读全文
posted @ 2017-09-01 10:29 Mr.曹 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 使用 Vue.js 2.0 模仿百度搜索框 <!DOCTYPE html Vue模拟百度搜索 body, html{ padding: 0; margin: 0; } box{ margin top: 80px; display: flex; flex direction: column; alig 阅读全文
posted @ 2017-09-01 09:52 Mr.曹 阅读(586) 评论(0) 推荐(0) 编辑