![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
与vue相关的工具,填坑等等
qlingsu
这个作者很懒,什么都没留下…
展开
-
前端下载并读取excel并转成对象数组array
xlsx.js可以读取excel,可以使用前端下载下excel文件,并将其中内容转为对象数组,方便处理。例如,在vue-cli3.0或4.0中,将excel作为静态文件,放到public下,通过路径可以访问到。其中axios请求到的文件格式为arraybufferaxios({ method: "get", url: "文件名.xlsx", responseType: "arraybuffer", }).then((res) =>原创 2021-04-21 09:12:25 · 1821 阅读 · 0 评论 -
前端pdf操作
vue-pdf 对pdf.js进行了二次封装。为了适应项目,做了如下改动在pdfjs包中找到es5/pdf.worker.js在pdf.worker.js 中,注释掉_this3.setFlags(_util.AnnotationFlag.HIDDEN) 可以让电子签章显示。在vue-pdf中,使用canvas渲染pdf文件页面。微信中不支持下载pdf文件,而且canvas也无法另存为图片。这里采用增加img标签的方法,让canvas渲染的我图片再次渲染到img标签中。这样就可以在微信中..原创 2021-01-26 17:22:24 · 1063 阅读 · 0 评论 -
v-for与ui框架琐记
el-tree 在for循环的时候,this.$refs[treeref]是取不到树的,需要使用this.$refs[treeref][0] 加上这个[0]vue-charts 在for循环的时候,options 不能在for循环中取,会造成不渲染。原因未知。暂时解决方法是用另一个数组去装options...原创 2020-12-30 09:44:54 · 126 阅读 · 0 评论 -
vue使用createElement异步渲染组件
采用了两种方式第一种方式,vue模板组件建立一个vue文件 ,假如名字叫mountElement.vue<template> <div id="mountedDiv"></div></template><script>import { isVNode } from "@/plugin/VnodeUtil";import TempSlot from "./TempSlot";import Vue from "vue";e原创 2020-10-09 09:14:36 · 3234 阅读 · 0 评论 -
vue让相同组件只显示一个
常用的有单例模式,也可以采用组件间通信的方法如下<template> <div > <div @click="showComponent"> </div> <div class="x-class" v-show="show"> </div> </div></template><script>import Vue from "vue";va原创 2020-08-17 09:48:44 · 1422 阅读 · 0 评论 -
vue-cli3和vue-cli4中vue.config.js给sass变量赋值
var appConfig = require("./public/appConfig")var styleVariables = appConfig.style;//在module.exports = {}中插入webpack配置configureWebpack: { module: { rules: [{ test: /\.scss$/, use: [ .原创 2020-07-31 17:48:53 · 1991 阅读 · 1 评论 -
vue-cli3发布npm包
configureWebpack: { // webpack 设置,可覆盖默认配置 entry: './src/index.js', output: { path: path.resolve(__dirname, './dist'), // publicPath: '/dist/', filename: 'zhuqingPlugins.js',...原创 2020-04-20 20:01:14 · 1385 阅读 · 1 评论 -
[Vue warn]: Failed to mount component: template or render function not defined.
vue异步组件 require("***/***")的时候报错[Vue warn]: Failed to mount component: template or render function not defined.试用 能搜索到的教程,试用require("***/***").default不好用后来发现是vue-loader版本的问题"vue-loader": "^12....原创 2020-04-16 16:04:42 · 1509 阅读 · 0 评论 -
vue-cli3脚手架使用过程中遇到的几个小问题
Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'新版webpack module.exports和import无法共存 将module.exports 改成export defaultvue-cli3 脚手架It's not allowed ...原创 2020-03-25 15:34:52 · 666 阅读 · 0 评论 -
使用vue-cli3搭建的工程集成cytoscape.js时候图像偏移的问题
vue-cli3搭建工程默认app的div上有#app {font-family: Avenir, Helvetica, Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;text-align: center;color: #2c3e50;}...原创 2020-03-18 13:36:11 · 144 阅读 · 0 评论 -
vue-cli3 报错 upgrade
经过调查是vue.config.js中的proxy写的有问题,修复proxy写法之后问题消失Starting development server...10% building 2/2 modules 0 active ERROR TypeError: Cannot read property 'upgrade' of undefinedTypeError: Cannot read pr...原创 2020-03-17 12:11:40 · 1511 阅读 · 0 评论 -
vue工程vue-cli或只依赖webpack打包的循环依赖和内存溢出Maximum call stack size exceeded Array.join
项目报错且启动不起来。错误大致如下RangeError: Maximum call stack size exceeded Array.join 往往是因为项目中有循环依赖比如vue-router中采用异步路由,require("*/**")或import("*/**");而被引入的组件中又依赖router或上一层,导致webpack打包模块循环依赖。或是req...原创 2020-03-12 22:33:26 · 1481 阅读 · 0 评论 -
ElementUI2.0组件库el-table自定义表头下拉选择 表头筛选
<template> <el-popover placement="bottom" width="180" trigger="click"> <el-select v-model="value" placeholder="请选择" clearable @change="changeHandler" ...原创 2020-03-10 14:05:19 · 7788 阅读 · 6 评论 -
百度地图api和echarts3+vue2热力图填坑
import hangzhouData from "./hangzhou-tracks.json";//杭州热力图数据import heatmap from 'echarts/lib/chart/heatmap';//热力图import bmap from 'echarts/extension/bmap/bmap';//bmapimport echarts from 'echar...原创 2020-03-02 15:48:16 · 786 阅读 · 2 评论 -
vue-cli-service 参数配置
vue-cli-service serveUsage: vue-cli-service serve [options]Options: --open 服务器启动时打开浏览器 --copy 将URL复制到服务器启动时的剪贴板 (直接到浏览器去粘贴就OK了 http://localhost:8080/) --mode 指定环境模式 (默认: development)...原创 2020-03-02 10:46:42 · 10639 阅读 · 0 评论