- 博客(46)
- 问答 (1)
- 收藏
- 关注
原创 js 正则记录
这些模式被用于 RegExp 的 exec 和 test 方法,以及 String 的 match、matchAll、replace、search 和 split 方法。
2024-02-29 14:16:27
1213
原创 js数组方法总结
【代码】js数组方法总结。reduce、map、forEach、filter、slice、push、pop、reverse、splice等
2023-04-17 13:51:27
2096
原创 vue3 api使用记录
vue3 API使用stop停止监听watchEffectawaitref reactive toRefs toRefs之间的关系ref/reactive可触发页面改变toRefs toRef不可触发页面改变只有toRefs支持解构ref可用于任何类型的数据创建响应式,reactive只用于创建引用数据类型的响应式(对于基本类型ref的性能优于reactive)toRefs:......
2022-07-06 16:22:45
924
原创 使用pnpm+vite创建vue
(踩坑中……)目录一、创建项目步骤二、vite使用记录1、vite使用eslint2、vite 使用sass,不需要安装sass-loader:3、vite使用mock:4、vite使用axios5、vite使用vue-router6.使用pinia7.使用pinia-plugin-persist一、创建项目步骤没得axios/vueRouter,啥都要自行安装pnpm安装:https://blog.youkuaiyun.com/xiao_cheng_/article/details/124247953p
2022-04-27 14:02:18
3997
原创 pnpm安装
pnpm安装 、报错记录设置源pnpm config get registry // 查看源pnpm config set registry http://registry.npm.taobao.org // 切换淘宝源使用pnpm install 包pnpm i 包pnpm add 包 // -S 默认写入dependenciespnpm add -D // -D devDependenciespnpm add -g // 全局安装pnp
2022-04-18 13:56:41
12944
原创 window新建ssh
window创建ssh第一步:ssh-keygen -t rsa -C '邮箱地址'//一路回车即可,这样可以不用输入密码第二步:eval $(ssh-agent -s)第三步:ssh-add ~/.ssh/id_rsa第四步:复制.ssh文件夹下的id_rsa.pub中的内容,地址demo:第五步:在github–>setting–>SSH and GPG keys–>new ssh keytitel中自定义输入key中复制id_rsa.pub的内容
2022-02-25 15:24:42
1951
原创 vue3 + jest 使用记录
vue3 + jest + VTU使用问题记录1、判断dom元素中是否包含某个元素import addEditUser from '@/views/UserManage/addUser.vue'import ElementPlus from 'element-plus'import { mount } from '@vue/test-utils'describe('addEditUser', () => { const wrapper = mount(addEditUser, {
2022-02-17 09:15:05
1088
4
原创 vue3子组件触发父组件方法
vue3子组件触发父组件方法子组件<template> <div @click="confirm ">啦啦啦啦</div></template><script setup>import { defineEmits } from 'vue'const emit = defineEmits(['editConfirm'])const confirm = () => { emit('editConfirm', true)
2022-02-09 10:53:57
5661
3
原创 vue3 父组件调用子组件的方法
vue3调用子组件的方法子组件<template><div></div></template><script setup>import { defineExpose } from 'vue'const dialogShow = (data) => { console.log(data)}defineExpose({ dialogShow})</script>父组件<template&
2022-01-29 13:32:22
26852
5
原创 vue3 setup 子组件接受并修改父组件的值
vue3中 使用setup子组件接收父组件传过来的值,并修改该值父组件<template> <add-user v-model:dialogAddVisible="dialogAddVisible" /></template><script setup>import AddUser from './addUser.vue'import { ref, watch } from 'vue'const dialogAddVisible = ref(
2022-01-21 13:06:22
7869
6
原创 vue3 报错合集
vue3报错合集1、使用el-table时报错: Uncaught (in promise) TypeError: Converting circular structure to JSON --> starting at object with constructor ‘Object’ | property ‘vnode’ -> object with constructor ‘Object’— property ‘component’ closes the circle原本只
2022-01-20 10:22:52
10645
2
原创 jest Cannot log after tests are done. Did you forget to wait for something async in your test?
vue项目运行jest时报Cannot log after tests are done. Did you forget to wait for something async in your test?的错误,但是并不影响测试结果。(看着太难受,遂找了一下解决办法)解决:import { mount } from '@vue/test-utils' //中的mount改为shallowMount=>import { shallowMount } from '@vue/test-utils'
2021-11-29 10:26:27
1207
1
原创 Failed to execute ‘readAsArrayBuffer‘ on ‘FileReader‘: parameter 1 is not of type ‘Blob‘
Failed to execute ‘readAsArrayBuffer’ on ‘FileReader’: parameter 1 is not of type ‘Blob’在vue中使用FileReader时遇到Failed to execute ‘readAsArrayBuffer’ on ‘FileReader’: parameter 1 is not of type 'Blob’的报错,尝试了new Int8Array、readAsArrayBuffer等方式却依旧没有解决。多次调试后发现是因为
2021-11-10 10:09:14
17677
9
原创 jest vue $route报错
jest vue $route报错运行jest时,在使用了$route的页面中一直报错,在jest中添加下方代码时又会报其他的错误错误的:test('创建groupManage数据', async (done) => { wrapper.vm.$nextTick(() => { //代码块 }) done() }) })最后发现是因为jest文件中没有添加router正确的:import VueRouter from 'vue
2021-11-05 11:24:15
903
原创 jest axios vuex报错
jest axios vuex报错vue项目使用jest时报 groupManage › encountered a declaration exceptionTypeError: Cannot read property ‘state’ of undefined的相关错误原因是因为jest文件中未引入vuexgroupmanage.spec.js:import { createStore } from 'vuex';const store = createStore({ state()
2021-11-05 11:15:35
631
原创 SassError: Invalid css after ““;expected 1 selector or at-rule, was ‘import “****“‘
在给scss起别名时,页面一直报错:SassError: Invalid css after “”;expected 1 selector or at-rule, was 'import “****” 和一些其他的Sass错误,但是在我本地的开发中并没有报错,一旦在服务中使用就报错,晚上搜到的办法都无法解决我的问题,今天无意间找到了问题所在。原因是vue.config.js中文件别名配置时没配置好。正确的代码: vue.config.jsconst path = require('path')fun
2021-11-03 14:56:34
5881
原创 vue img onerror事件及vite img src
vue img onerror事件当图像的地址不能使用时,使用默认的图片<img :src="scope.row[item.prop]" @error="defaultSrc"/>defaultSrc () { const img = event.srcElement // 刚开始是以参数的形式定义的,但是默认的图片一直不能使用,遂改为此方式 img.src = './20211103110717.png' // 默认一张图片。若是public中的图片,直接 ./ 就可以
2021-11-03 13:40:30
1604
原创 nvm安装
文章目录一、下载二、使用一、下载nvm最新版本:链接: https://github.com/coreybutler/nvm-windows/releases.选择nvm-setup.zip下载即可。nvm -v查看版本号二、使用nvm arch [32|64] : 显示node是运行在32位还是64位模式。指定32或64来覆盖默认体系结构。nvm install <version> [arch]: 该可以是node.js版本或最新稳定版本latest。(可选[arch])指定
2021-10-16 21:26:19
311
原创 git报错合集
文章目录git报错合集导入git报错合集clone代码时报错:fatal: unable to access ‘https://github.com/xxxxxx.git/’: Error in the HTTP2 framing layer,解决: git config --global --unset http.proxy git config --global --unset https.proxy导入如果你想加载一篇你写过的.md文件,在上方工具栏可以选择导入功能进行对应
2021-10-16 20:41:08
8263
原创 VueAwesomeSwiper使用时超过最大堆栈调用大小
VueAwesomeSwiper使用时超过最大堆栈调用大小vue项目使用VueAwesomeSwiper时报了Uncaught RangeError: Maximum call stack size exceeded的错误,经网上查找解决办法发现是vue的name属性不能设置为“swiper”<template> <div class="swiper"> <swiper :options="swiperOption"> <swiper
2021-09-17 11:01:24
244
原创 js数组元素移至头部
js数组元素移至头部下面展示一些 内联代码片。// A code blockvar foo = 'bar';// An highlighted blockvar foo = 'bar';
2021-09-16 14:51:28
707
原创 vue使用EventSource
vue使用EventSourcemounted() {if(typeof (EventSource) !== 'undefined') { //支持eventSource var postURL = 'http……'; this.source = new EventSource(postURL); let self = this;//因EventSource中this的指向变了,所以要提前存储一下 this.source.onopen = function
2021-09-16 13:55:55
2506
原创 js数组对象排序
js数组对象排序js数组对象按照其中的某个属性排序第一种function arrayObjSortSimple(type,sort) { return function(a,b) { if(sort === 'desc') {//降序 return b[type] - a[type]; } else {//升序asc return a[type] - b[type]; } } } let order = [ {
2021-09-15 18:13:55
323
原创 html2canvas图片截屏
前言工作使用到了html2canvas插件,刚开始踩了不少坑,在此记录,引以为戒 一、pandas是什么?<button class="screenCapture">截屏</button> <ul id="ul1"> <li> <img src="img/3.jpg" width="200" height="150" /> </li> <li> &
2021-06-29 11:32:20
300
原创 简易跑马灯
一、简易跑马灯代码如下(点击按钮后会改变背景颜色):html:<div id="box"> <button>跑马灯</button> <button>跑马灯</button> <button>跑马灯</button> <button>跑马灯</button> <button>跑马灯</button> <button&g
2021-05-11 10:20:52
209
原创 div水平垂直居中
一、div水平垂直居中div水平垂直居中第一种:div{ width:200px; height:100px; position:absolute/fixed; top:50%; left:50%; margin-top:-50px; margin-left:-100px; //本身宽高的一半}总结纸上得来终觉浅,绝知此事要躬行...
2021-05-07 11:38:23
65
原创 css小知识点
文章目录前言一、css取消默认样式二、前言提示:这里可以添加本文要记录的大概内容:例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。提示:以下是本篇文章正文内容,下面案例可供参考一、css取消默认样式取消a标签的下划线:text-decoration:none;取消a标签的蓝色字体颜色:color: #333;取消h1-h6的默认粗体:font-weight:normal;ul、li取消默认样式:list-sty
2021-05-06 15:14:40
173
原创 js编写拖拽效果
一、js编写拖拽效果代码如下(示例):<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <
2021-05-06 11:26:26
221
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人