会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
jason_wang
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2023年2月9日
React面试题---setState是同步执行还是异步执行?
摘要: 1. React中 setState是同步执行还是异步执行?什么时候是同步什么时候是异步? 1 import React, { Component } from "react"; 2 import ReactDOM from "react-dom"; 3 // this.setState 到底是同步
阅读全文
posted @ 2023-02-09 17:08 zhijie_wang
阅读(48)
评论(0)
推荐(0)
2021年11月25日
git 踩坑日记——避免把别人的代码顶掉
摘要: 有时候为了在提交代码时避免跟别人的代码冲突和可能顶掉别人的代码,可以使用下面的方法 3.
阅读全文
posted @ 2021-11-25 18:53 zhijie_wang
阅读(325)
评论(0)
推荐(0)
vite中alias别名配置
摘要: vire.config.js 1 // resolve.alias 2 import { 3 defineConfig 4 } from 'vite' 5 import path from "path"; 6 import vue from '@vitejs/plugin-vue' 7 8 9 //
阅读全文
posted @ 2021-11-25 18:41 zhijie_wang
阅读(1827)
评论(0)
推荐(0)
2021年10月29日
用正则把身份证号中间的年月日变成星号显示
摘要: export function changeIdCardIncludeStart (cardId:string) { const newStr = cardId.replace(/^(.{6})(?:\d+)(.{4})$/,"$1****$2"); return newStr; }
阅读全文
posted @ 2021-10-29 16:50 zhijie_wang
阅读(612)
评论(0)
推荐(0)
2021年10月28日
通用把手机号中间四位数改成星号来显示
摘要: 用正则把手机号中间四位变为星号* 从本地或者路由中获取到手机号 vue mounted:{ let str = this.$route.params.phone; let reg = /^(\d{3})\d*(\d{4})$/; let str2 = str1.replace(reg,'$1****
阅读全文
posted @ 2021-10-28 17:24 zhijie_wang
阅读(673)
评论(0)
推荐(0)
vscode格式化工具遇到的坑
摘要: 在 vscode 中使用格式化工具遇到的一些问题 比如:使用 beautify 格式化代码,出现的效果如下: 这就是我遇到的问题 换成 Prettier - Code formatter 后 所以还是 Prettier - Code formatter 好使一些
阅读全文
posted @ 2021-10-28 11:06 zhijie_wang
阅读(208)
评论(0)
推荐(0)
代码提交时的一些规范 -- git commit
摘要: module.exports = { extends: ['@commitlint/config-conventional'], rules: { 'body-leading-blank': [1, 'always'], 'footer-leading-blank': [1, 'always'],
阅读全文
posted @ 2021-10-28 09:57 zhijie_wang
阅读(162)
评论(0)
推荐(0)
2021年10月27日
vscode页面顶部添加注释信息
摘要: 首先需要在 vscode中安装一个插件 > KoroFileHeader 然后找到设置 在输入框中输入 "fileheader" 1 { 2 "files.autoSave": "afterDelay", 3 // 文件头部注释 4 "fileheader.customMade": { 5 6 "D
阅读全文
posted @ 2021-10-27 16:07 zhijie_wang
阅读(539)
评论(0)
推荐(0)
2021年10月23日
react 踩坑1
摘要: 今天遇到一个问题 ERROR in Entry module not found: Error: Can't resolve './src' in 'C:\Users\土豆\Desktop 找了一个多小时,才发现是 useState 写成了 userState; 在网上找了好久没找到主要解决办法
阅读全文
posted @ 2021-10-23 23:48 zhijie_wang
阅读(9)
评论(0)
推荐(0)
2021年9月30日
vue 移动端拖拽 + 吸附效果
摘要: <template> <div class="floatball" id="floatball" @mousedown.="down" @touchstart.stop="down" @mousemove.prevent="move" @touchmove.prevent="move" @mouse
阅读全文
posted @ 2021-09-30 15:40 zhijie_wang
阅读(1601)
评论(0)
推荐(0)
1
2
下一页
公告