摘要: 场景 vue项目,vite配置了基本路径前缀/h5 在页面内,通过js进行页面跳转 问题 使用window.location.href = '目标地址',结果发现实际跳转地址会变成本地地址前缀+目标地址,e.g. https://loacalhost:9999/h5/www.baidu.com 解决 阅读全文
posted @ 2023-12-25 13:58 Karle 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 请求图形验证码,后端通过流式返回图片结果 前端需要进行结果处理,才能使用:scr渲染图片 创建blob对象,处理流对象 如何为blob资源创建一条URL,能够渲染到页面 const blob = new Blob([result], { type: 'image/png' }) return (wi 阅读全文
posted @ 2023-12-23 17:10 Karle 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 作用 Components 引于 unplugin-vue-components,用于解决vue文件内无需手动引入组件,减少import的调用 基本配置 在vite配置文件中,作为插件使用 import { defineConfig } from 'vite' import Components f 阅读全文
posted @ 2023-12-23 16:09 Karle 阅读(175) 评论(0) 推荐(1) 编辑
摘要: 二叉排序树 class Node { constructor(value) { this.value = value this.left = null this.right = null } } class Tree { constructor() { this.root = null this.t 阅读全文
posted @ 2023-12-15 18:45 Karle 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 简单哈希表 class Pair { constructor(key, value) { this.key = key this.value = value } } class Hash { constructor() { this.buckets = new Array(100).fill(nul 阅读全文
posted @ 2023-12-14 16:32 Karle 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1.类型 //rename data type type NAME = string const jackName : NAME = 'Jack Jay' //rename mixed data type type PHONE = string | number const jackPhone : 阅读全文
posted @ 2023-12-07 16:10 Karle 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1.数据类型 1.1 基本数据类型 const a: number = 1 const b: string = '123' const c: boolean = true //undefined and null belongs to other types const d: null = null 阅读全文
posted @ 2023-12-06 18:43 Karle 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 单链表 class Node { constructor(data) { this.data = data this.next = null } } class NodeList { constructor() { this.head = null this.length = 0 } appendN 阅读全文
posted @ 2023-11-27 18:06 Karle 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 异或运算 1.0和任何数字异或 任何数字本身 2.相同数字异或 0,不相同数字异或 1 3.遵循交换律,结合律 题目 给定一个包含 [0, n] 中 n 个数的数组 nums ,找出 [0, n] 这个范围内没有出现在数组中的那个数。 输入:nums = [3,0,1] 输出:2 输入:nums = 阅读全文
posted @ 2023-11-07 11:00 Karle 阅读(14) 评论(0) 推荐(0) 编辑
摘要: ??空值合并运算符 判断一直变量是否为'null'/'undefined',进行不同的返回值处理 console.log(1 ?? 2) // 1console.log(null ?? 2) // 2console.log(undefined ?? 2) // 2console.log(1 ?? 2 阅读全文
posted @ 2023-10-17 18:42 Karle 阅读(142) 评论(0) 推荐(0) 编辑