vue 项目中 @ 符号没有路径提示
1、vs-code 下载“Path Intellisense”插件。2、打开设置 - 首选项 - 搜索 Path Intellisense - 打开 settings.json ,添加123"path-intellisense.mappings": { "@": "${workspaceRoot}/src" } 或者在项目根目录新建文件夹.vscode,在.vscode 建立 settings.json 文件12345{ "path-intellisense.mappings": { "@": "${workspaceRoot}/src" }} 3、在 vue 项目 package.json 所在同级目录下创建文件 jsconfig.json123456789{ "compilerOptions":...
vue 设置本地 ssl 安全证书
安装 mkcert123https://github.com/FiloSottile/mkcert/releases/latest或https://hub.fastgit.org/FiloSottile/mkcert/releases/latest 下载 exe 文件重命名为 mkcert.exe 设置命令1mkcert -install 生成 HTTPS 证书1mkcert 127.0.0.1 localhost vue 使用根目录新建 ssl 文件夹将生成文件放入 配置 vue.config.js 12345678910const path = require('path')const fs=require("fs") devServer: { host:"127.0.0.1", // 配置本地ssl证书 https:{ key: fs.readFileSync(path.join(__dirname,...
validator.js
validator 中文设置thinkjs3.0 的 validator.js在src/config目录新建validator.js 内容1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859module.exports = { messages: { required: '{name}: 不能为空值', contains: '{name}: 必须包含 {args}', mobile: '{name}: 手机号码格式错误', equals: '{name}: 的值应该和 {args} 相等', different: '{name}:...
think-svg-captcha
安装1npm i think-svg-captcha 使用js 引入 12const ThinkSvgCaptcha = require('think-svg-captcha');// const path = require('path'); js 使用1234567891011121314151617181920212223242526const defaultOptions = { size: 4, // 验证码的个数 ignoreChars: '', // 过滤掉一些字符 noise: 3, // 干扰线的数量 color: true, // 默认灰色,如果设置了背景选项,则为true background: '#F3FBFE', // svg图像的背景色 width: 120, // 验证码宽度 height: 40, // 验证码高度 fontSize: 45, // 验证码字体大小 // fontPath:...