摘要: 1、addClass\removeClass\classList(js) jQ:$('#div').addClass('hover') document.getElementById('div').classList.add('hover') jQ:$('.div').removeClass('ho 阅读全文
posted @ 2016-03-27 00:07 chenguiya 阅读(299) 评论(0) 推荐(0) 编辑
摘要: { "compilerOptions": { /* * 用于拓宽引入非相对模块时的查找路径的。其默认值就是"./" * 目的是解决项目代码层级较深相互之间引用起来会比较麻烦的问题,各种 …/,…/…/,…/…/…/ 等等 * "paths": { * "@vue": ["packages/vue/s 阅读全文
posted @ 2022-07-21 09:36 chenguiya 阅读(1519) 评论(0) 推荐(0) 编辑
摘要: 我的解决方案:执行以下脚本: npm uninstall sass-loader node-sassnpm install sass-loader@8.0.2 sass@1.26.5 --save-dev不要安装node-sass,安装sass就可以了,package.json如下: "devDep 阅读全文
posted @ 2022-07-19 20:14 chenguiya 阅读(496) 评论(0) 推荐(0) 编辑
摘要: 1、函数promise new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>; const main = new P 阅读全文
posted @ 2022-06-09 09:43 chenguiya 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 在ES6中判断变量是否为数组鉴于数组的常用性,在ES6中新增了Array.isArray方法,使用此方法判断变量是否为数组,则非常简单,如下: Array.isArray([]); // => true Array.isArray({0: 'a', length: 1}); // => false 阅读全文
posted @ 2022-04-20 19:51 chenguiya 阅读(305) 评论(0) 推荐(0) 编辑
摘要: wx.downloadFile({ url:"https://xxxxxx.pdf", success(res){ console.log(res) let data = res.tempFilePath; wx.openDocument({ filePath:data, fileType:'pdf 阅读全文
posted @ 2020-03-25 10:16 chenguiya 阅读(4901) 评论(0) 推荐(0) 编辑
摘要: 第一种方式: 阅读全文
posted @ 2019-05-21 16:53 chenguiya 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 一、原型链继承 通过对象child的prototype属性指向父对象parent的实例,使child对象的实例通过原型链访问到父对象构造所定义的属性、方法等。 二、使用apply、call方法 js中call和apply都可以实现继承,唯一的一点参数不同,func.call(func1,var1,v 阅读全文
posted @ 2018-05-22 11:30 chenguiya 阅读(442) 评论(0) 推荐(0) 编辑
摘要: ECMAScript的语法使用 https://blog.csdn.net/m0_37452696/article/details/78370504 ECMAScript 6简介说明 http://jsrun.net/tutorial/dZKKp ECMAScript 6 入门 https://es 阅读全文
posted @ 2018-05-16 21:35 chenguiya 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 实例一: 待处理字符串:str="display=test name=mu display=temp" 要求:把display=后的值都改成localhost JS处理方法: str.replace(/display=\w*/g,"display=localhost"); 原为来自:http://w 阅读全文
posted @ 2017-10-17 14:21 chenguiya 阅读(2029) 评论(0) 推荐(1) 编辑
摘要: 1、使用 create-react-app 快速构建 React 开发环境 国内使用 npm 速度很慢,你可以使用淘宝定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm: 阅读全文
posted @ 2017-07-17 14:48 chenguiya 阅读(2737) 评论(0) 推荐(0) 编辑