摘要: js观察者模式 // config/Event.js class Event { handlers; constructor() { this.handlers={} } on (type, fn) { this.handlers[type] = this.handlers[type] || []; 阅读全文
posted @ 2020-09-25 09:50 happynood 阅读(89) 评论(0) 推荐(0) 编辑
摘要: md5是前端常见的加密方式,简单的数字,字母加密很容易破解,因此通常加入“盐”,使他不容易被破解。 Install npm install utility Usage const utils = require('utility'); function md5Pwd(pwd) { const sal 阅读全文
posted @ 2020-09-18 16:26 happynood 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 使用修饰器 安装依赖,注意babel版本号。 npm install @babel/plugin-proposal-decorators --save 配置babel "babel": { "plugins": [ [ "@babel/plugin-proposal-decorators", { " 阅读全文
posted @ 2020-09-18 16:16 happynood 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 1.文本模糊 .vague { color: transparent; text-shadow: 0 0 5px rgba(0,0,0,0.5); } 阅读全文
posted @ 2020-07-17 14:23 happynood 阅读(216) 评论(0) 推荐(0) 编辑
摘要: /** 为函数定义类型 */ // 为函数的参数指定类型,为函数的返回值指定类型 function add(x: number, y: number): number { return x + y; } let myAdd = function (x: number, y: number): number { return x + y; } // 完整的函数 let myAdd2:... 阅读全文
posted @ 2019-07-19 22:29 happynood 阅读(1064) 评论(0) 推荐(1) 编辑
摘要: /** 为函数定义类型 */ // 为函数的参数指定类型,为函数的返回值指定类型 function add(x: number, y: number): number { return x + y; } let myAdd = function (x: number, y: number): number { return x + y; } // 完整的函数 let myAdd2:... 阅读全文
posted @ 2019-07-18 21:48 happynood 阅读(257) 评论(0) 推荐(1) 编辑
摘要: 星期一 星期二 星期三 星期四 星期五 星期六 星期天 阅读全文
posted @ 2019-04-26 14:10 happynood 阅读(440) 评论(0) 推荐(1) 编辑
摘要: 创建项目 引入antd组件库 在package.json的.babel配置antd 在app.css里引入antd的css 引入scss预编译器 阅读全文
posted @ 2019-03-12 14:32 happynood 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 自己写个弹框,两个小点,一个是垂直居中,一个是点击弹框外的部分弹框消失,点击弹框弹框不消失 环境是vue的环境,比较简单 阅读全文
posted @ 2019-01-07 16:05 happynood 阅读(863) 评论(0) 推荐(0) 编辑
摘要: 声明js的基本类型1.数字let a: number = 2;2.字符串let aa: string = "22"3.数组(1) 数组元素: let b: number[] = [1, 2, 3];(2) 数组泛型: let b: Array<number> = [1, 2, 3];(3) cons 阅读全文
posted @ 2019-01-03 21:09 happynood 阅读(414) 评论(0) 推荐(0) 编辑