摘要: function downloadFile(url, filename) { var a = document.createElement('a'); a.href = url; a.download = filename; document.body.appendChild(a); a.click 阅读全文
posted @ 2022-09-19 15:37 Life_countdown 阅读(198) 评论(0) 推荐(0)
摘要: // 设置手动上传文件的请求 ts文件 import axios from 'axios' const Storage = createStorage({ storage: localStorage }) // 创建axios实例 const service = axios.create({ bas 阅读全文
posted @ 2022-09-08 17:12 Life_countdown 阅读(1731) 评论(0) 推荐(0)
摘要: 不要使用v-modle:show='props.show' 的方式。因为使用v-modle后,会警告不能直接修改父组件的值,只是可读的 应该采用: :show='props.show' @update:show='changeShow' 配合@update:show方法监听传过来的值,最后通过emi 阅读全文
posted @ 2022-09-01 15:25 Life_countdown 阅读(781) 评论(0) 推荐(0)
摘要: interface THeadItem { key: string title: string tooltip?: boolean width?: string } // 指定 需要是键值对的形式 并且value是string(也可以是number等) 解决在xxx上面找不到xxx类型参数的索引签名 阅读全文
posted @ 2022-08-01 14:57 Life_countdown 阅读(704) 评论(0) 推荐(0)
摘要: 1、为input 密码框 添加autocomplete="new-password" 属性(不知是不是写的有问题,无效) 2、为input 密码框 绑定:readonly="isReadonly" 属性(默认为true) a、在模态框中使用,在模态框弹出时延迟一秒将isReadonly修改为fals 阅读全文
posted @ 2022-06-17 10:03 Life_countdown 阅读(278) 评论(0) 推荐(0)
摘要: // 需要转化为base64格式 // 修改文件流 import axios from 'axios' axios .get(`${import.meta.env.VITE_JAVA_API_URL}/....`, { responseType: 'arraybuffer', params: { . 阅读全文
posted @ 2022-06-10 18:20 Life_countdown 阅读(173) 评论(0) 推荐(0)
摘要: // 首先安装 npm install file-saver xlsx -S // 在utils文件下新建excel文件 import { saveAs } from 'file-saver' import { WorkBook, WorkSheet, utils, SSF, write } fro 阅读全文
posted @ 2022-05-30 13:36 Life_countdown 阅读(808) 评论(0) 推荐(0)
摘要: // .directive.ts const permissionFn = (value: string | string[]) => { // 后端返回的是权限数组,存在本地,取出来处理 const rolesArr = JSON.parse(getItem('roles')) if (typeo 阅读全文
posted @ 2022-05-26 19:45 Life_countdown 阅读(650) 评论(0) 推荐(0)
摘要: // 子组件 const count = ref(1) const submit = () => { console.log(123213) } // 通过defineExpose把方法或值暴露出来 defineExpose({ submit,count }) // 父组件 利用ref绑定子组件,直 阅读全文
posted @ 2022-05-11 15:32 Life_countdown 阅读(1078) 评论(0) 推荐(0)
摘要: <!-- 父组件--> <div class="main"> <!-- 父组件通过v-model绑定值--> <Detail :id="id" v-model:is-edit="isEdit" /> </div> <!-- 子组件--> <div class="child"> <span @clic 阅读全文
posted @ 2022-04-25 14:13 Life_countdown 阅读(560) 评论(0) 推荐(0)