前端开发
qq_21651453
这个作者很懒,什么都没留下…
展开
-
js 封装方法
//1.指定元素后插入domfunction insertAfter(newElement, targetElement) { var parent = targetElement.parentNode; if (parent.lastChild === targetElement) { parent.appendChild(newElement); } else { parent.insertBefore(newElement, targetE..原创 2020-10-12 13:56:34 · 184 阅读 · 0 评论 -
前端自定义动态主题
theme.jsfunction Theme() { var that=this this.style=null init() function init() { that.style=document.createElement('style') that.style.type = 'text/css'; //这里必须显示设置style元素的type属性为text/css,否则在ie中不起作用 that.style.id..原创 2020-09-18 14:17:42 · 604 阅读 · 0 评论 -
vue static 静态资源copy-webpack-plugin
1、npm install copy-webpack-plugin@5.0.0 (其他版本可能不适用)2、build/webpack.prod.conf.js添加:const CopyPlugin=require('copy-webpack-plugin')plugins:[...new CopyPlugin([ { form:'static', //从哪个静态资源目录下获取资源: 项目根目录下static目录 to:'static' 打...原创 2020-08-26 11:58:39 · 1061 阅读 · 0 评论 -
react+mock 前端不依赖后台服务的开发
1、安装 npm install mockjs -D2、配置mock (1)数据文件:data.js import Mock, {Random}from 'mockjs'let data=[]for(let i=0;i<Math.random()*10;i++){ let item= { title:Random.cparagraph...原创 2020-03-25 10:31:06 · 220 阅读 · 0 评论 -
react+react-pdf-js 前端pdf在线预览插件
"react": "^16.13.1" "react-read-pdf": "^2.0.9" 这两个对应版本实测无问题,其他版本有的实测有问题(hook问题)1、 npm install react-pdf-jsimport history from '../../router/history'const PDFUrl=require('../../static/file/t...原创 2020-03-24 14:03:22 · 3034 阅读 · 1 评论 -
video-react
https://video-react.js.org/https://blog.csdn.net/xue_sunshine_girl1/article/details/83505758原创 2020-01-10 16:20:35 · 188 阅读 · 0 评论 -
creact react app 自定义eslint校验规则
npm run eject => 开启本地配置=>添加配置文件1、npm run eject 暴露dev文件2、webpack.config.js 文件中eslint配置处开启useEslintrc: true (注意开启关闭规则时设置cache: true 的值为false否则缓存可能为影响校验展示结果){ test: /\.(js|mjs|jsx|t...原创 2019-11-11 16:50:09 · 699 阅读 · 0 评论