摘要: <canvas id="canvas" width="600" height="600"></canvas> const canvas = document.getElementById("canvas"); const ctx = canvas.getContext("2d");// 获取2D渲染 阅读全文
posted @ 2024-12-31 09:53 玖捌 阅读(34) 评论(0) 推荐(0)
摘要: /* 校验是否是excel */ export const isExcel = (file) => { return /\.(xlsx|xls|csv)$/.test(file.name); }; /* 校验身份证号码 */ export const checkCardNo = (value) => 阅读全文
posted @ 2024-12-23 11:18 玖捌 阅读(23) 评论(0) 推荐(0)
摘要: 页面代码: <template> <view> <web-view :src="fileUrl"></web-view> </view> </template> <script> export default { data() { return { fileUrl: "", pdfViewUrl: 阅读全文
posted @ 2024-08-27 16:50 玖捌 阅读(1531) 评论(0) 推荐(0)
摘要: type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0]; const getBase64 = (img: FileType, callback: (url: string) => void) => { const rea 阅读全文
posted @ 2024-03-20 14:47 玖捌 阅读(50) 评论(0) 推荐(0)
摘要: unction truncateDecimal(num) { const decimalRegex = /\.\d{1,2}/; const result = decimalRegex.exec(num.toString()); if (result) { return result[0]; } r 阅读全文
posted @ 2024-01-11 13:48 玖捌 阅读(12) 评论(0) 推荐(0)
摘要: 官网下载 开发工具 https://developer.harmonyos.com/cn/develop/deveco-studio使用开发者工具 需要有 华为开发者账号 https://www.harmonyos.com/ 阅读全文
posted @ 2023-12-04 16:49 玖捌 阅读(25) 评论(0) 推荐(0)
摘要: react useEffect a页面跳转b页面,b页面跳转a页面,接口调用多次 useEffect(() => { xxx(); return () => { history?.go(0); }; }, []); 我的解决方式是在,在离开页面之前触发return () => {history?.g 阅读全文
posted @ 2023-07-27 16:31 玖捌 阅读(161) 评论(0) 推荐(0)
摘要: function getBase64Image(img) { var canvas = document.createElement("canvas"); canvas.width = img.width; canvas.height = img.height; var ctx = canvas.g 阅读全文
posted @ 2023-04-07 14:21 玖捌 阅读(58) 评论(0) 推荐(0)
摘要: window.onbeforeunload = function (e) { const dialogText = 'cancel?'; e.returnValue = dialogText; return dialogText; }; useEffect(() => { window.onbefo 阅读全文
posted @ 2023-02-08 15:50 玖捌 阅读(37) 评论(0) 推荐(0)
摘要: 开始 一、 项目搭建 指令下载 npx create-react-app 项目名字 --template typescript 二、下载完后 npm i 下载node_module包 三、 npm i npm-pakage --save-dev 这里面 下载的 东西是要区分的 --save-dev 阅读全文
posted @ 2023-01-05 14:05 玖捌 阅读(254) 评论(0) 推荐(0)