自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

小蜜蜂的博客

转前端之路

  • 博客(28)
  • 资源 (2)
  • 收藏
  • 关注

原创 antdesign select组件 search事件在触发blur事件之前会返回空值

我这边的场景是用户输入了内容之后,如果可以查询到数据,然后用户可以选择查询到的数据。如果查询不到数据,那么就使用用户输入的数据。因为开启了 show-search ,就会去用你输入的匹配下了选项中的内容,如果没查到,就会返回空。然后在onChang事件里 把searchInputValue 置空,不能影响原有的逻辑。在触发blur事件前会触发search事件,并返回一个空值,1.4之前是没有这个机制的。我查看了源代码,现在是在失去焦点是,会自动清空searchText.只需要借助两个事件,加一个缓存变量;

2024-05-11 14:40:56 258

原创 ant design form-model resetFields() 重置表单无效

ant design form-model resetFields() 重置表单无效特别注意一: 如果是下拉框需要重置重新显示placeholder,初始值需要设置undefined特别注意二:使用resetFields时务必,加上prop和rules,即使需求不需要校验此时方能生效...

2022-07-13 09:52:28 1259 1

转载 canvas不兼容IE问题

canvas不兼容ie问题

2022-06-22 14:11:47 552

原创 nvm安装npm失效解决办法(全网唯一)

nvm安装npm

2022-06-11 12:47:19 637

原创 vscode开发前端必备插件

vscode开发前端必备插件

2021-12-06 10:17:09 147

原创 Promise setTimeout NextTick执行顺序

const first = () => (new Promise((resolve, reject) => { console.log(3); let p = new Promise((resolve, reject) => { console.log(7); setTimeout(() => { console.log(5); resolve(6); }, 0) .

2021-12-03 16:44:16 774

原创 text-indent妙用

一般会采用把该段文字分成两个span进行布局展示,会比较废手;那么可不可以换个方式呢,我们都知道text-indent是让首行缩进,那么我们奇思妙想反过来搞岂不是和我们这个需求刚好匹配呢;实现css:{text-indent: -2em; padding-left: 2em;}就能实现如上的需求了,yyds...

2021-08-14 10:02:54 119

原创 使用JS刷题如何处理输出

出现多组不确定的数据时,使用下面process.stdin.on('end', function () { arr.forEach(function(el, index) { if (el === 1) { console.log(index); } });})监听end

2021-01-14 23:39:02 220

原创 微信小程序组件data定义的变量

微信小程序组件data定义的变量,页面不能直接使用,需要通过data: {beforeVal:false,},this.setData({beforeVal:!this.beforeVal})之后方能使用<view wx-if="{{beforeVal}}">1</view><view wx-else>2</view>也就是...

2021-01-13 17:04:49 1421

原创 Using eslint with typescript - Unable to resolve path to module import/no-unresolved

.eslintrc.js文件settings:{'import/resolver':{'node':{"extensions":[".js",".jsx",".ts",".tsx"]}}},

2021-01-12 17:09:04 2576

原创 输出所有文件名及路径到txt,xlxs

使用命令cmd命令即可,dir /b /s *.js*>node.txt,这是输出所有js文件;

2021-01-12 13:46:35 194

原创 报错node/no-deprecated-api,node/process-exit-as-throw......

eslint-plugin-node用法1.npm install --save-dev eslint eslint-plugin-node2..eslintrc.js文件{"extends":["eslint:recommended","plugin:node/recommended" // 采用建议的规则],"parserOptions":{//OnlyESLint6.2.0...

2021-01-12 10:36:56 499 1

原创 报错promise/no-return-wrap,promise/param-names,promise/catch-or-return。。。。

eslint-plugin-promise 使用第一步:npm install eslint-plugin-promise --save-dev第二步: .eslintrc.js文件{"plugins":["promise"]}第三步:Then configure the rules you want to use under the rules section..eslintrc.js文件{"rules"...

2021-01-12 10:14:05 592

原创 Cannot read property ‘bindings‘ of null

你应该在.babelrc文件配置"presets":["@babel/typescript",["@babel/env",{"targets":{"chrome":"67"},"loose":true,"useBu...

2021-01-11 17:19:03 292

原创 Error:Unexpected end of JSON input while parsing near ‘…

npm cache clean --force

2021-01-11 16:14:30 204

原创 text.trimEnd is not a function

If you're not yet on node 10 or greater, you'll have to use prettier v1.x until you upgrade to a supported node version报这种错通常是node版本过低,需要10以上。或者降低prettier版本到1

2021-01-11 14:46:44 414

原创 “@babel/plugin-proposal-class-properties“,    “@babel/plugin-proposal-object-rest-spread“,

帮助生成符合规范的代码,参考https://babel.docschina.org/docs/en/babel-plugin-proposal-class-properties/和https://babeljs.io/docs/en/babel-plugin-proposal-object-rest-spread通过.babelrc使用

2021-01-11 11:12:40 877

原创 vscode 搜索与替换(正则)

"../cells/cells" ========》"../vx-cells/vx-cells";搜索"../([a-zA-Z-]{1,8})/([a-zA-Z-]{1,8})" 替换"../vx-$1/vx-$2"

2021-01-10 21:09:29 1252

原创 批量替换文件名

bat文件内容如下@echo offtitle 文件bai名字符替du换mode con cols=60 lines=20::文件要是重名,会提示错误。setlocal EnableDelayedExpansion & color 0a:1set a=set b=set c=cls&echo.set /p a= 请输zhi入要被替换的字符:cls&echo.set /p b= 请输入替换“!daoa!”的字符,若要去掉zhuan“!a!”,请直接shu车:

2021-01-06 23:31:37 121

原创 批量替换文件夹名

bat文件如下@echo offtitle 文件bai名字符替du换mode con cols=60 lines=20::文件要是重名,会提示错误。setlocal EnableDelayedExpansion & color 0a:1set a=set b=set c=cls&echo.set /p a= 请输zhi入要被替换的字符:cls&echo.set /p b= 请输入替换“!daoa!”的字符,若要去掉zhuan“!a!”,请直接shu车:f

2021-01-06 22:02:02 186

原创 const { Math, Object } = primordials; ReferenceError: primordials is not defined

解决方案一:升级gulp到v4-不可取;解决方案二:降级Node到v11-不可取;解决方案三:项目下新建一个文件npm-shrinkwrap.json,内容:{"dependencies":{"graceful-fs":{"version":"4.2.2"}}}然后npm i;即可解决报错;说明:要固定graceful-fs到version4.2.2,我们需要使用一个npm-shrinkwrap.json文件,...

2021-01-06 11:40:55 779 2

原创 Newline required at end of file but not found  eol-last

开发微信小程序组件库时编译时报错Newline required at end of file but not found eol-last在wxs或js或ts文件末尾需要换行,1.Component({2.3.})4.

2020-12-29 10:00:24 1490

原创 Cannot pull, git cannot resolve reference ORIG_HEAD

Cannot pull, git cannot resolve reference ORIG_HEAD拉取代码的时候 Cannot lock the ref ‘ORIG_HEAD’.这样解决:I solved it by removing the file .git/ORIG_HEAD then doing the pull again. The .git/ORIG_HEAD file was 0 bytes instead of the git reference it was supposed t

2020-12-23 15:25:10 792

原创 beforeRouteEnter和beforeRouteUpdate的坑

beforeRouteEnter是新进入的一个路由,比如进入/login登录界面,会触发beforeRouteEnter这个钩子;而beforeRouteUpdate是路由更新时触发,从主页进入登录界面不会触发这个钩子函数,一个父路由下的子路由跳转会触发这个钩子函数。...

2018-10-29 11:33:51 11859

原创 input聚焦边框问题

聚焦时边框使用 outline: none即可去边框;默认边框使用 border: none去边框

2018-10-23 15:44:35 6564

原创 VUE项目,从mongodb后台获取的对象数组,前端对其进行排序

methods: {    //升序排序,js中方法    sortRole (pro) {        return function (a,b) {            var value1 = a[pro];            var value2 = b[pro];            return value1 - value2;         }...

2018-09-29 16:35:27 666

原创 使用vue-cli初始化webpack模板的vue项目,npm run dev 启动时会打印很多日志,影响开发!!!

解决方法:初始化时package.json中的一个脚本是这样的(高亮):"scripts": {    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",    "build": "node build/build.js"  },此时启动项目,日志会从1%打印到10...

2018-09-19 18:00:29 4070

原创 使用webpack模板初始化项目时,proxyTable配置无效!!

使用vue init webpack your-project-name初始化vue项目时,项目结构在此就不多说。里面config文件夹下index.js文件中有个proxyTable配置,此配置是代理转发所用。当向服务器端口(与vue项目不同端口,即跨域请求)请求数据时,代码是某个vue页面中methods下axios.get('/users').then((res)=&gt;{console....

2018-09-19 17:11:12 4931 2

canvas不兼容ie的问题,所需的三个js文件

canvas不兼容ie的问题,所需的三个js文件

2022-06-22

教师测评系统完整源码,直接导入能部署成功

因为是完整的,经过本人测试,花了比较久的时间,希望有点回报,赚点积分

2017-08-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除