Nodejs+Express+Vue 分片上传文件

Vue <template> <div class="upload"> <el-upload :before-upload="befUpload" class="upload-demo" drag action="/" :show-file-list="false" > <el-icon class="el-icon--upload"><upload-filled /></el-icon> <div class="el-upload__text">拖拽或<em>点击上传</em></div> </el-upload> </div> <...

read more..

Axios封装 2.0

import axios from "axios"; import { Notify } from 'vant'; // 这个是异常提醒弹框. vant或者ele的,在或者其他的 import router from '@/router'; // 做跳转 //下面三个是错误处理. 底下的拦截判断出异常. 这里通过 errorCreate new一个Error, 然后在使用 errorLog 打印出来在页面提示一下. 可以直接写成提示的 function errorCreate(msg) { const error = new Error(msg) errorLog(msg) ...

read more..

Vue移动端轮播图 中间大,两边露一点

npm install vue-awesome-swiper@3 npm install swiper <template> <div v-if="items.length" class="full-page-slide-wrapper"> <swiper :options="swiperOption" ref="mySwiper"> <!-- slides --> <template v-for="(item, i) in items"> <swiper-slide v-if="item" :key="i"> <img @click="toTopic(item)" :src="i...

read more..

IOS封装的H5移动端页面底部小黑条

ios封装的web端应用, 滚动到底部后还能继续朝下滚动,出现空白 通过监听 touchmove,让需要滑动的地方滑动,不需要滑动的地方禁止滑动。 App.vue页面 created() { document.body.addEventListener( "touchmove", (e) => { if (e._isScroller) return; e.preventDefault(); }, { passive: false, } ); }, html,body { height:...

read more..

H5打电话发短信

<meta name="format-detection" content="telephone=yes"/> <a href="tel:13660007710">13660007710</a> <a href="sms:13660007710">13660007710</a>

read more..

粘贴图片 ctrl+v

document.addEventListener("paste", function (event) { var isChrome = false; if (event.clipboardData || event.originalEvent) { //某些chrome版本使用的是event.originalEvent var clipboardData = event.clipboardData || event.originalEvent.clipboardData; if (clipboardData.items) { // for chrome var items = c...

read more..

Vue axios返回文件流

responseType:"blob", 请求接口的时候加上 let blob = new Blob([res], { type: "application/vnd.ms-excel", }); let url = window.URL.createObjectURL(blob); let link = document.createElement("a"); link.download = 'zz.xlsx' link.style.display = "none"; link.href = url; document.body.appendChild(link); ...

read more..