cookie,local,session操作 class Storage { // constructor(options) { } constructor () { console .log( 'constructor' ) } // 获取_key的数据 => { data, keyInfo } _getData(_key) { console...
node 实现本地代码调试远程接口(反向代理并加header(cookie)等) 有个需求,现有oa 要加个页面,本地新建的html文件要联调并获取远程数据,要涉及跨域,跨域解决方案多种就不赘述了,用node简单实现这个功能 目录根目录新建server.js,如下: const express = require('express'); const timeout = require...
create-react-app React is not defined 报错解决方法 用 create-react-app 创建项目后 执行 npm run eject 暴露配置 启动项目就报错了: React is not defined jsx 运行时的 webpack 配置会在 eject 时候被删除 所以需要在 package.json 把配置加回来 // package.jso...
微信小程序wx.request方法报 request:fail -2:net::ERR_FAILED的问题 小程序ios正常访问没问题,安卓机请求服务器报"request:fail -2:net::ERR_FAILED" 目前判断下来是由于服务器的SSL证书是使用中间证书颁发的,而服务器中缺少中间证书导致小程序无法验证服务器证书链完整性 使用 https://www.cnblogs.com/masahiro/...
vue scss修改主题 //换主题 theme(type) { this.$store.commit('upDate', {themeType: type}); window.document.documentElement.setAttribute( "data-theme", type ); } 1.安装依赖 npm in...
优化 Webpack 1)优化 Webpack 的构建速度 使用高版本的 Webpack (使用webpack4) 多线程/多实例构建:HappyPack(不维护了)、thread-loader 缩小打包作用域: exclude/include (确定 loader 规则范围) resolve.modules 指明第三方模块...
chrome离线通知 首先创建renderKey.js const webpush = require('web-push'); //VAPID keys should only be generated only once. const vapidKeys = webpush.generateVAPIDKeys(); co...
ant select动态渲染实现默认选中 <Select defaultValue={ textInput[i]["option"][0]?textInput[i]["option"][0]['value']:''} key={ textInput[i]["option"][0]?textInput[i]["option"][0]['value...
vue cli3打包优化 const path = require("path"); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const isProduction = process.env.NODE_ENV === 'production'; con...
element-ui对话框可拖拽及边界处理 功能实现代码directives.js代码如下: import Vue from 'vue'; // v-dialogDrag: 弹窗拖拽属性 Vue.directive('dialogDrag', { bind(el, binding, vnode, oldVnode) { const dialogH...