摘要: 单链表 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 阅读(14) 评论(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 阅读(71) 评论(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 阅读(168) 评论(0) 推荐(0)
摘要: Vite插件依赖于Rollup,遵循Rollup规则 每次在其他文件中调用`import ... from ...` 便会执行该插件 最终将该`import`得到的数据转化为自定义插件load()返回的数据 必须定义plugin name 编写resolveId(id):用于解析import文件、模 阅读全文
posted @ 2023-10-17 17:18 Karle 阅读(262) 评论(0) 推荐(0)
摘要: 背景 在网络请求后,将数据保存到Vuex中,需要对state中数据进行修改,使用到mutation 需求是在state.votes中找到对应的对象,然后替换成新的对象 const mutations = { UPDATEVOTE(state, data) { const { votes } = st 阅读全文
posted @ 2023-09-18 21:19 Karle 阅读(176) 评论(0) 推荐(0)
摘要: 背景 在template中使用了<form></form>,在form中使用了button button绑定了onClick事件,进行非提交表单的操作 当点击button时页面会自动刷新 原因 form标签在提交的时候会自带刷新页面的请求 button标签默认type="submit",放在form 阅读全文
posted @ 2023-09-15 13:15 Karle 阅读(122) 评论(0) 推荐(0)
摘要: 项目背景 一个Electron+vue2的桌面应用项目,进行打包 使用了vue-cli-plugin-electron-builder将Electron和vue结合 直接使用electron-builder打包 问题一:打包后,background.js中会出现模块引入报错。Electron是com 阅读全文
posted @ 2023-09-15 12:58 Karle 阅读(751) 评论(0) 推荐(0)
摘要: 下载NSSM应用软件 下载地址 http://nssm.cc/downloa 将安装包解压到目标文件夹,打开路路径D:\nssm\nssm-2.24\win64 安装注册响应Windows服务 在当前目录下执行cmd打开终端 输入nssm install 服务名,成功后会打印Administrato 阅读全文
posted @ 2023-09-15 11:21 Karle 阅读(128) 评论(0) 推荐(0)
摘要: Vue 项目使用socket.io 使用library socket.io-client 或者 vue-socket.io npm install socket.io-client || npm install vue-socket.io 使用socket.io-client socket.io-c 阅读全文
posted @ 2023-09-06 12:06 Karle 阅读(1336) 评论(0) 推荐(0)
摘要: 日常练习 用vue2封装轮播图组件,传入图片信息数组。 实现思想: 图片组添加translate动画,通过轮播到第几张图片作为参数,让图片组整体移动。 Carousel.vue <template> <div class="carousel"> <div class="carouselList"> 阅读全文
posted @ 2023-05-02 15:54 Karle 阅读(527) 评论(0) 推荐(0)