12 2020 档案

摘要:vue自定义指令的作用 定义任何的DOM操作,并且是可复用的。 集成第三方插件。 vue自定义指令的实现 注册自定义指令: 全局自定义指令 // 自定义权限指令 Vue.directive('permission', { inserted (el, binding) { // el: 代表使用了此指 阅读全文
posted @ 2020-12-24 14:06 shine_lovely 阅读(272) 评论(0) 推荐(0) 编辑
摘要:<template> <div> {{ time | formatTime }} {{ status | getDicVal(statusDic) }} </div> </template> statusDic: [ { key: '1', value: '启用' }, { key: '2', va 阅读全文
posted @ 2020-12-22 10:52 shine_lovely 阅读(62) 评论(0) 推荐(0) 编辑
摘要:node中express的,res.send() 或res.json()这类客户端返回的方法仅返回一次,如果多次返回就会出现这个错误! 一般是因为 if…else 判断时出错 阅读全文
posted @ 2020-12-21 09:29 shine_lovely 阅读(731) 评论(0) 推荐(0) 编辑
摘要:在ts爬虫代码练习时,用cheerio来获取网页中数据时 const viewCountTemp = $(e).find('.postDesc').eq(idx).find('.post-view-count').text() // "阅读(5)" infoItem.viewCount = pars 阅读全文
posted @ 2020-12-18 14:32 shine_lovely 阅读(1752) 评论(0) 推荐(0) 编辑
摘要:1. 新建文件夹。 crowller 2. 在文件夹下,进行 npm init -y ,进行初始化,出现package.json文件。 3. 在文件夹下,进行 tsc --init , 新增typescript的配置文件 tsconfig.json 4. 安装typescript文件,ts-node 阅读全文
posted @ 2020-12-11 16:48 shine_lovely 阅读(729) 评论(0) 推荐(0) 编辑
摘要:1. 简单创建一个class 类 1 class Person { 2 // name:string; 3 // constructor(name:string){ 4 // this.name = name 5 // } 6 // 简化写法 在构造器的参数前面加上 访问属性,就是默认添加一个参数名 阅读全文
posted @ 2020-12-11 16:36 shine_lovely 阅读(211) 评论(0) 推荐(0) 编辑
摘要:实现思路 1.设置input 属性hidden对该input进行隐藏,或者通过display:none也可以 <input type="radio" name="type" id="adviceRadio1" value="1" checked hidden/> 2.借助label for标签通过i 阅读全文
posted @ 2020-12-03 10:41 shine_lovely 阅读(219) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示