09 2022 档案
摘要:GET请求直接传数组给后端,格式会错误, 转换传参格式,JS中将数组变成字符串:数组[arr] + ’ ’ axios.get('/gateway/xxx', { params: { name: 'lvxiaobu', list: [1,2,3] + '', } })
阅读全文
摘要:dialog <template> <div> <el-dialog title="切换考试" top="9vh" :modal="false" width="600px" :visible.sync="dialogVisible" @close="close" :append-to-body="t
阅读全文
摘要:await api(html).then(res => { const blob = new Blob([res], { type: 'application/pdf;charset-UTF-8' }) const url = URL.createObjectURL(blob) window.ope
阅读全文
摘要:### 方法一 ``` const printWindow = window.open() printWindow.document.write(document.querySelector('#printBox').innerHTML) printWindow.print() printWindo
阅读全文
摘要:
阅读全文
摘要:export default function imgUrlToBase64 (url, callback, outputFormat) { var canvas = document.createElement('CANVAS') var ctx = canvas.getContext('2d')
阅读全文
摘要:// 实现一个Event Bus class EventEmitter { constructor() { // handlers是一个map,用于存储事件与回调之间的对应关系 this.handlers = {} } // on方法用于安装事件监听器,它接受目标事件名和回调函数作为参数 on(ev
阅读全文
摘要:// 定义发布者类 class Publisher { constructor() { this.observers = [] } // 增加订阅者 add(observer) { this.observers.push(observer) } // 移除订阅者 remove(observer) {
阅读全文
摘要:1 介绍 被抽象化的webpack,我们要想去理解它默认的一些配置的话是比较困难的,所以我们可以通过指令去查看。 该指令会将webpack的配置输出到output.js文件,这样方便去查看。 vue inspect > output.js vue.config.js文件 这个文件导出了一个包含了选项
阅读全文
摘要:dialog组件 <template> <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-bind="$attrs" v-on="$listeners" ref="dlg" :modal="modal"
阅读全文