摘要: vite.config.ts中设置 server: { proxy: { '/apis': { target: 'http://localhost:44311/', // 实际请求地址 changeOrigin: true, rewrite: (path) => path.replace(/^\/a 阅读全文
posted @ 2024-05-19 21:07 静坐仰望星空 阅读(13) 评论(0) 推荐(0) 编辑
摘要: Vue3+axios+.Net使用分片上传 前端代码 在ApiService.cs中增加方法 //上传文件 public static async uploadFile(file){ const chunkSize = 1024 * 1024; // 1MB 每1mb分片 const totalCh 阅读全文
posted @ 2024-05-19 21:07 静坐仰望星空 阅读(11) 评论(0) 推荐(0) 编辑
摘要: npm安装 npm install --save sm-crypto //使用 import {sm2,sm3,sm4} from 'sm-crypto' // sm2 //获取密钥对 let keypair = sm2.generateKeyPairHex() publicKey = keypai 阅读全文
posted @ 2024-05-19 21:05 静坐仰望星空 阅读(75) 评论(0) 推荐(0) 编辑
摘要: !!!!!!!已使用另一个截图上传工具,稍后更新博客!!!!!! 使用vue-cropper进行截图上传 先安装 npm i vue-cropper 编写组件 在components中添加imageCropper.vue 代码如下 <template> <div> <div> <img v-if=" 阅读全文
posted @ 2024-05-19 21:05 静坐仰望星空 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 基于Vue Router的代码 import {useRoute, useRouter} from "vue-router"; const router=useRouter(); const route=useRoute(); // 根据地址跳转 router.push('/eweb/test1') 阅读全文
posted @ 2024-05-19 21:03 静坐仰望星空 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 为了快速编写信息提示代码,封装如下 core\helper中增加swalMessage.ts,代码如下 代码 import Swal from "sweetalert2" declare interface SwalMessage { success(title:string,msg:string) 阅读全文
posted @ 2024-05-19 21:03 静坐仰望星空 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 基础思路就是编辑当前信息,弹框,修改后保存,数据即刻刷新 示例代码: const editInfo = (info0) => { //深复制,防止编辑的时候更新页面绑定数据 info.value = JSON.parse(JSON.stringify(info0)); if (!info.value 阅读全文
posted @ 2024-05-19 21:02 静坐仰望星空 阅读(15) 评论(0) 推荐(0) 编辑
摘要: Vue3+nanoid编写字符串ID生成器 中文介绍:https://github.com/ai/nanoid/blob/HEAD/README.zh-CN.md 一个小巧、安全、URL友好、唯一的 JavaScript 字符串ID生成器。 “一个惊人的无意义的完美主义水平,这简直让人无法不敬佩。” 阅读全文
posted @ 2024-05-19 21:01 静坐仰望星空 阅读(11) 评论(0) 推荐(0) 编辑
摘要: Vue3+Yup进行数据验证 npm安装: npm i yup 使用 import * as Yup from "yup"; //配置 const login = Yup.object().shape({ // username为string格式,必填(错误提示为:请输入用户名) username: 阅读全文
posted @ 2024-05-19 21:00 静坐仰望星空 阅读(28) 评论(0) 推荐(0) 编辑
摘要: npm包地址:https://www.npmjs.com/package/vue3-puzzle-vcode npm安装 npm install vue3-puzzle-vcode --save 最简单例子: <template> <Vcode :show="isShow" @success="on 阅读全文
posted @ 2024-05-19 20:59 静坐仰望星空 阅读(44) 评论(0) 推荐(0) 编辑