随笔分类 - vue
关于vue的web一些随笔
摘要:方法一:如果文件是域名的,可以使用微软免费接口 //由于免费的在线查看,不支持ip+端口的形式所以单独处理 this.dialog.url='http://view.officeapps.live.com/op/view.aspx?src='+ encodeURIComponent(this.dia
阅读全文
摘要:1.前端使用html2canvas是需要注意配置 crossorigin="anonymous" <div class="c-l-c" ref="lz-image2"> <img class="image" :src="dataObj.matchFile.fileUrl +'?'+ new Date
阅读全文
摘要:1.首先安装gulp npm install gulp -g 全局安装gulp 2.在当前目录下打开cmd 执行:npm init 创建package.json文件 然后安装第一个插件gulp-uglify cnpm install gulp-uglify --save-dev 3.这时候已经可以开
阅读全文
摘要:1.首先2.8.335版本之前引入方式 import pdfJS from "pdfjs-dist"; import workerSrc from 'pdfjs-dist/build/pdf.worker.entry' pdfJS.workerSrc = workerSrc; //或者使用 impo
阅读全文
摘要:第一种方式使用render import Vue from 'vue' import store from '../../../src/store' import selectSign from '@/components/selectSignatory/selectSignatory.vue' f
阅读全文
摘要:1.使用的场景是把html转换成PDF保存下来,代码: /* eslint-disable */ import html2canvas from 'html2canvas'; import JsPDF from 'jspdf'; /** * @param ele 要生成 pdf 的DOM元素(容器)
阅读全文
摘要:1 在vue的utils中新建一个dialogDrag.js import Vue from 'vue' Vue.directive('dialogDrag', { bind(el, binding, vnode, oldVnode) { //弹框可拉伸最小宽高 let minWidth = 400
阅读全文
摘要:/* message在同一位置弹出 */ /* reset elementUI message */ .el-message { top: 20px !important; } .el-message:not(:last-child) { visibility: hidden; } /* messa
阅读全文
摘要:1.报错信息没有安装python环境 1 gyp ERR! find Python 2 gyp ERR! find Python Python is not set from command line or npm configuration 3 gyp ERR! find Python Pytho
阅读全文
摘要:npm i v-charts echarts -S 引入 import VCharts from 'v-charts' Vue.use(VCharts) 后发现报错,后来发现安装echarts版本太高使用4.8.0是没有问题的 npm install echarts@^4.8.0
阅读全文
摘要:更改router 的base // biz是二级目录,路由文件改成 const router = new VueRouter({ mode: 'history', // base: process.env.BASE_URL, base: '/biz/', // biz是二级目录 routes })
阅读全文
摘要:let arr=[{ title:'1', key:'1', type:0, children:[{ title:'1-1', key:'1-1', type:0, }] },{ title:'2', key:'2', type:0, children:[] },{ title:'3', key:'
阅读全文
摘要:npm i v-charts echarts -S 1.在main.js中使用报以下错 liquidFill echarts/lib/visual/dataColor 找不到 出现此原因是因为版本问题 npm WARN echarts-liquidfill@2.0.6 requires a peer
阅读全文
摘要:1.公司项目用户账号密码登录,使用了rsa加密,针对不同版本做了不同需求,不影响之前的版本, 使用了自定义请求头“yx_version” //拦截器设置全局请求token Vue.http.interceptors.push((request, next) => { if(localStorage.
阅读全文
摘要:1.APP反编译 使用hbx云打包,打包出apk 拿到apk后,先下载反编译工具 https://pan.baidu.com/s/1A5D8x_pdSELlHYl-Wl6Xnw 提取码 6vzd 使用反编译工具进行apk反编译(记住此时的apk不能使用加固后的apk,否则回编译后apk打不开),反编
阅读全文
摘要:1.可以根据自身情况封装获取配置文件接口信息 1.1我在static中新建一个config.json配置文件 { "DEV_URL":"/apis",//开发模式 "BUILD_URL": "/apis"//打包之后接口 } 2.我在每次请求之前都会获取配置文件,你也可以只获取一次做下判断即可 //
阅读全文
摘要:1安装三个依赖包 npm install -S file-saver@2.0.2 npm install -S xlsx@0.15.6 npm install -D script-loader@0.7.2 2导入两个js 下载Blob.js和Export2Excel.js,在src目录下新建Exce
阅读全文
摘要:(Emitted value instead of an instance of Error) the "scope" attribute for scoped slots have been deprecated and replaced by "slot-scope" since 2.5. Th
阅读全文
摘要:// const path = require('path'); module.exports = { /** 区分打包环境与开发环境 * process.env.NODE_ENV 'production' (打包环境) * process.env.NODE_ENV 'development' (开
阅读全文
摘要:1.去掉多余的库 将不必要的库卸载掉 npm uninstall xxx 举个例子:例如moment库文件是很大的,在前端可以用js的 new Date实现获取日期,或者可以其他库代替,也可以将moment库放在服务端用,将所有关于时间的处理放到服务端进行。 2.路由懒加载 将下图中的1改为2,详细可以百度搜索 vue路由懒加载 3.开启服务端gzip压缩 我这里用的是nginx,所以下找到ngi
阅读全文

浙公网安备 33010602011771号