Vue JSX/TSX $attrs用法
<el-table data={this.data} height={this.height} {...{ props: this.$attrs, on: this.$listeners, }} ></el-table>
生活其实很有趣
<el-table data={this.data} height={this.height} {...{ props: this.$attrs, on: this.$listeners, }} ></el-table>
import html2canvas from "html2canvas" import JSPDF from "jspdf" 封装 printPdf.js // 导出页面为PDF格式 import html2canvas from "html2canvas" import JSPDF from "jspdf" export default { // eslint-disable-next-line install (Vue, options) { Vue.prototype.ExportSavePdf = function (htmlTitle, currentTime) { var element = document.getElementById("pdfCent...
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> <...
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) ...
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...
ios封装的web端应用, 滚动到底部后还能继续朝下滚动,出现空白 通过监听 touchmove,让需要滑动的地方滑动,不需要滑动的地方禁止滑动。 App.vue页面 created() { document.body.addEventListener( "touchmove", (e) => { if (e._isScroller) return; e.preventDefault(); }, { passive: false, } ); }, html,body { height:...
<meta name="format-detection" content="telephone=yes"/> <a href="tel:13660007710">13660007710</a> <a href="sms:13660007710">13660007710</a>
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...