前端
卤鸽子
一个只会写bug的卤鸽子
展开
-
Electron增量更新(兼容win7)
增量更新(兼容win7)服务器端-latest.yml-resources/app的文件夹打包app.zipapp.text -> 版本号记录,放在pulic文件夹下1.1.9module ->手动安装解压依赖,防止依赖冲突以及安装失败unzipper https://gitee.com/mirrors_silverwind/node-unzipper.giticonv-lite https://gitee.com/mirrors_addons/icon原创 2021-07-11 11:39:17 · 2765 阅读 · 1 评论 -
vue的自定义指令以及简单的permission指令
permission.jsexport default { //只调用一次,指令第一次绑定到元素时调用,用这个钩子函数可以定义一个在绑定时执行一次的初始化动作。 bind(el, binding) { }, //被绑定元素插入父节点时调用(父节点存在即可调用,不必存在于 document 中) inserted(el, binding) { /**传入的权限和指令的值进行对比*/ if (!store.getters.menuTree.includes(bindin原创 2021-05-12 11:55:15 · 1432 阅读 · 0 评论 -
Electron的配置以及自动更新
更新依赖npm install --registry=https://registry.npm.taobao.org手动明跳转路由location.hash = '#/chat'手动获取当前路由window.location.hrefelectron常用配置"build": { "productName":"xxxx",//项目名 这也是生成的exe文件的前缀名 "appId": "com.leon.xxxxx",//包名 "copyright":"xxxx"原创 2021-05-12 11:52:05 · 1604 阅读 · 0 评论 -
nuxt的使用和一些问题
/** cookie 安装 yarn: yarn add cookie-universal-nuxt npm: npm i --save cookie-universal-nuxt*/ { modules: [ ['cookie-universal-nuxt', { parseJSON: false }] ] } //store里使用 this.app.$cookies.set('token', res.login_name)原创 2021-03-03 14:52:05 · 357 阅读 · 1 评论 -
keeplive的使用
视图组件加载位置 /**max最大缓存页面数*/ <keep-alive max="5"> /** 需要缓存的视图组件*/ <router-view v-if="$route.meta.keepAlive" ></router-view> </keep-alive> /** 不需要缓存的视图组件 */ <router-view v-if="!$route.meta.keepAlive"原创 2020-12-09 11:14:36 · 1531 阅读 · 0 评论 -
vue里几种方法封装
通过Vue.prototype挂载/**common.js*/exports.install = function (Vue) { Vue.prototype.$Download = function (url, data) { //全局函数 } Vue.prototype.$fromatTable = function (L) { }};/**main.js*/import common from './common/common.js'Vue.use(com原创 2020-12-09 11:00:51 · 573 阅读 · 0 评论 -
vue里使用word模板导出word文档
npm i docxtemplater pizzip jszip-utils file-saver -S/**数据*/ form: { custName: "杰斯", // 客户姓名 phoneNumber: "138xxxxxxxx", // 联系方式 projectRequirement: "为了更美好的明天而战", // 项目要求 totalPrice: 140, // 合计报价 remark: "Q原创 2020-12-05 18:09:50 · 1456 阅读 · 0 评论 -
纯前端导出,导入excel并且修改excel样式
yarn add pikaz-excel-jsnpm i -S pikaz-excel-js/**html*/<excel-export :bookType="bookType" :filename="filename" :sheet="sheet" :on-error="onError"> <div class="export-btn">点击导出</div> </excel-export> <excel-import :on-suc转载 2020-12-05 17:23:22 · 915 阅读 · 1 评论 -
axios的封装,不仅限于vue使用
axios.js封装import axios from 'axios'// 创建axios实例let baseURL = process.env.VUE_APP_API_HOST// /dev本地的代理规则if (process.env.NODE_ENV == 'development') { baseURL = '/dev'}const service = axios.create({ //baseURL: process.env.VUE_APP_API_HOST, // api的bas原创 2020-12-04 10:50:26 · 186 阅读 · 0 评论 -
js下载上传处理数据流
/**原生文件下载*///*方式一* const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }); console.log(blob); const objectUrl = URL.createObjectURL(blob); window.location.href = objectUrl;//*方式二* var link = document.createElement('a'); link.hr原创 2020-11-28 10:47:47 · 388 阅读 · 1 评论 -
vue常用的config配置
/** 环境配置 .env # 在所有的环境中被载入 .env.local # 在所有的环境中被载入,但会被 git 忽略 .env.[mode] # 只在指定的模式中被载入 .env.[mode].local # 只在指定的模式中被载入,但会被 git 忽略**/const version = new Date().getTime();/**打包去console * npm install terser-webpack-p原创 2020-11-21 10:12:58 · 871 阅读 · 0 评论 -
vue高德地图异步加载
/**map.js*/export function MapLoader() { const mp = new Promise(function (resolve, reject) { let hasLoaded1 = document.getElementById("amap"); if (hasLoaded1) { // 只加载一次 return } window.init = function () { resolve(window.AMa原创 2020-11-21 10:11:30 · 671 阅读 · 0 评论 -
vue水印方法
let watermark = {}let setWatermark = (str) => { let id = '1.23452384164.123412416'; if (document.getElementById(id) !== null) { document.body.removeChild(document.getElementById(id)); } //创建一个画布 let can = document.createElement('canvas');原创 2020-11-21 10:06:59 · 753 阅读 · 0 评论 -
H5特性头部-
<!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓 --><meta name="HandheldFriendly" content="true"><!-- 微软的老式浏览器 --><meta name="MobileOptimized" content="320"><!-- uc强制竖屏 --><meta name="screen-orientation" content="portrait"&原创 2020-11-21 10:02:36 · 172 阅读 · 0 评论