摘要: /* * @param type(必填) * @param url(必填) * @param data(必填) * @parama callback(必填) */ function ajax(type,url,data,callback){ var xhr = XMLHttpRequest ? ne 阅读全文
posted @ 2019-12-04 19:42 好多坨屎 阅读(658) 评论(0) 推荐(0)
摘要: 首先,子组件代码如下 <template> <div style="border:1px solid black;width:400px;"> <h3>我是子组件里的</h3> <button>点击按钮子组件传递父组件</button> <div>我是父组件传子组件显示的:我还没有值</div> < 阅读全文
posted @ 2019-12-04 19:02 好多坨屎 阅读(4078) 评论(0) 推荐(0)
摘要: 1.h5新增的标签有哪些?为什么要加强语义化? h5新增的标签有video,audio,header,nav,aside,footer,article等 语义化可以使开发者能清晰的看出网页的结构,增强可读性 有利于seo 便于团队开发与维护 2.为什么要清除浮动?怎么清除浮动? 因为浮动会脱离文档流 阅读全文
posted @ 2019-12-03 10:00 好多坨屎 阅读(355) 评论(0) 推荐(0)
摘要: 网上一大堆乱七八糟的,其实就这行,然后获取到密钥复制到github里设置就可以了 ssh-keygen cat /root/.ssh/id_rsa.pub 阅读全文
posted @ 2019-12-02 14:46 好多坨屎 阅读(2813) 评论(0) 推荐(0)
摘要: 先不说一大堆乱七八糟的话,直接上代码,然后再解释 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <input type="text" id="username"> <input 阅读全文
posted @ 2019-12-01 20:35 好多坨屎 阅读(275) 评论(0) 推荐(0)
摘要: let arr = [1,2,3] let newArr = arr.map((item, i, arr) => { //item:遍历数组的每一项,i:数组当前项的下标,arr原数组 console.log(`item:${item}, i:${i}, arr:${arr}`) return it 阅读全文
posted @ 2019-12-01 18:19 好多坨屎 阅读(319) 评论(0) 推荐(0)
摘要: //express使用 const express = require('express') const app = express() app.listen(3001, () => { console.log("http://localhost:3001") }) app.use(express. 阅读全文
posted @ 2019-11-24 15:00 好多坨屎 阅读(668) 评论(0) 推荐(0)
摘要: 通过以下命令来使用npm安装http-server 安装完成后,切换到想要打开网页的目录,cmd输入http-server即可开启本地服务器 它会给出地址,根据地址就可以打开网页了,这样网页就挂载在本地服务器上了! 要退出按ctrl+c 阅读全文
posted @ 2019-11-15 19:48 好多坨屎 阅读(12375) 评论(0) 推荐(0)
摘要: 浅拷贝 function clone(origin,target){ for(var prop in origin){ if(origin.hasOwnProperty(prop)){ target[prop] = origin[prop]; } } return target; } 上述代码实现了 阅读全文
posted @ 2019-11-06 16:56 好多坨屎 阅读(570) 评论(0) 推荐(0)
摘要: 所谓寄生组合式继承,即通过构造函数来继承属性,通过原型式继承来继承方法,代码如下: function inheritPrototype(sub,sup){ var prototype = Object.create(sup.prototype); prototype.constructor = su 阅读全文
posted @ 2019-11-06 14:44 好多坨屎 阅读(263) 评论(0) 推荐(0)