
vue
jarisMA
这个作者很懒,什么都没留下…
展开
-
vue 自定义指令 触底加载
vue 自定义指令 触底加载Vue.directive('infinite-scroll', { bind: function (el, binding) { const callback = binding.value; el.addEventListener('scroll', e => binding.def.scroll(e, callback)); }, scroll: function (e, callback) { const targetDom =原创 2021-06-10 15:09:54 · 347 阅读 · 0 评论 -
原生js监听dom元素大小变化
原生js监听dom元素大小变化参考ResizeObserver这里是引用ResizeObserver avoids infinite callback loops and cyclic dependencies that are often created when resizing via a callback function. It does this by only processing elements deeper in the DOM in subsequent frames. Imp原创 2021-03-03 10:11:00 · 861 阅读 · 0 评论 -
vue打包时删除console.log
vue打包时删除console.log一、使用插件uglifyjs-webpack-plugin在vue.config.js中添加对应的配置const UglifyJsPlugin = require("uglifyjs-webpack-plugin");module.exports = { configureWebpack: { plugins: [ new UglifyJsPlugin({ uglifyOptions: { compr原创 2021-03-03 10:07:29 · 271 阅读 · 0 评论 -
vue拼接字符串
vue拼接字符串发布时间:2019-05-15 16:15:21直接上代码:<div class="swiper-slide" v-for="img in imgs"> <img :src="['xxx(需要拼接的字符串)'+img]" alt="" width="100%" height="auto" /></div>...原创 2019-08-29 10:21:28 · 1696 阅读 · 0 评论 -
vue读取xls或xlsx文件
vue读取xls或xlsx文件1.选择一款合适的xls插件,我选择的是xlsx安装:npm install xlsx2.template<template> <div> <input type="file" ref="upload" accept=".xls,.xlsx" @ch...原创 2019-08-29 10:29:09 · 5643 阅读 · 0 评论 -
vue中解决html2canvas图片跨域问题
vue中解决html2canvas图片跨域问题html2canvas在截图的过程中,如果遇到html中有跨域地址的图片,即图片地址非本地,截图的时候将不会显示图片解决方法:html<div ref="imageDom"> <!-- 支持跨域的地址 --> <img :src="imgUrl+'?'+new Date().getTime()"...转载 2019-08-29 10:33:16 · 5073 阅读 · 1 评论