微信小程序
meifeng88
信管小卒一名
展开
-
微信小程序组件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 · 1415 阅读 · 0 评论 -
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 · 2566 阅读 · 0 评论 -
输出所有文件名及路径到txt,xlxs
使用命令cmd命令即可,dir /b /s *.js*>node.txt,这是输出所有js文件;原创 2021-01-12 13:46:35 · 191 阅读 · 0 评论 -
报错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 · 488 阅读 · 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 · 580 阅读 · 0 评论 -
Cannot read property ‘bindings‘ of null
你应该在.babelrc文件配置"presets":["@babel/typescript",["@babel/env",{"targets":{"chrome":"67"},"loose":true,"useBu...原创 2021-01-11 17:19:03 · 282 阅读 · 0 评论 -
Error:Unexpected end of JSON input while parsing near ‘…
npm cache clean --force原创 2021-01-11 16:14:30 · 195 阅读 · 0 评论 -
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 · 412 阅读 · 0 评论 -
“@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 · 860 阅读 · 0 评论 -
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 · 1250 阅读 · 0 评论 -
批量替换文件名
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 · 119 阅读 · 0 评论 -
批量替换文件夹名
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 · 183 阅读 · 0 评论 -
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 · 762 阅读 · 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 · 1487 阅读 · 0 评论