![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
snowkei
前路昭然,你我共进。
展开
-
vue-页面添加水印
const warterMark = {};/** * * @param {要设置的水印的内容} str * @param {需要设置水印的容器} container */const setWatermark = (str, container) => { const id = '1.23452384164.123412415'; if (container === undefined) { return; } // 查看页面上有没有,原创 2021-11-03 18:05:39 · 338 阅读 · 0 评论 -
v-drag:实现拖拽功能
v-drag鼠标拖动directives: {drag: function(el) {let dragBox = el // 获取当前元素let num = nulldragBox.onmousedown = e => {// 算出鼠标相对元素的位置const disX = e.clientX - dragBox.offsetLeftdocument.onmousemove = e => {// 用鼠标的位置减去鼠标相对元素的位置,得到元素的位置const left = e原创 2021-10-21 18:50:42 · 278 阅读 · 0 评论 -
vue 从后台下载文件
// 调用后台接口this.axios.post(url, param,{responseType: "blob",headers:{ 'Content-Type': 'application/json; application/octet-stream'} }.(res=>{ this.downloadZip(res,'下载文件名')}),// 下载downloadZip(res,name) { if(res.size>0){ // 判断文件是否存在 let bl原创 2021-04-07 16:03:24 · 471 阅读 · 0 评论 -
vue项目部署到服务器浏览器缓存问题
部署后进入使用ctrl+F5清除浏览器缓存,可以解决如果不想使用ctrl+F5j解决的话可以考虑以下解决方案:1、在vue项目中解决在入口文件index.html添加:<meta http-equiv="pragram" content="no-cache"><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"><meta http-equiv="expires"原创 2021-04-07 15:52:42 · 2061 阅读 · 0 评论