摘要: //scss @mixin textColor($color) { .tagWord { color: $color; } } @mixin borderRadius($radius) { border-radius: $radius; } &:global(.ant-tag-blue) { @in 阅读全文
posted @ 2022-04-06 17:40 葫芦娃啊 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 报错后在浏览器点击报错,可以直接在编辑器内打开报错 eg: 需要提前准备的内容: 编辑器变量在 shell 中可以访问 webstrom 相关的配置 https://www.jetbrains.com/help/webstorm/opening-files-from-command-line.htm 阅读全文
posted @ 2022-04-06 16:47 葫芦娃啊 阅读(15) 评论(0) 推荐(0) 编辑
摘要: SAAS 技术说明 SAAS 是以 react 为基础的 SPA 形式网站 主要技术栈 TS 代码质量控制 REACT 主要技术框架 REDUX 全局数据共享 ├── build 打包后的文件路径 ├── public 静态HTML文件 ├── scripts 项目打包脚本 ├── package. 阅读全文
posted @ 2022-04-06 16:40 葫芦娃啊 阅读(146) 评论(0) 推荐(0) 编辑
摘要: ### git文件名修改后提交远程无变化 git config core.ignorecase false 再通过git status就能找到你修改文件名大小写后的变更了 阅读全文
posted @ 2022-04-06 16:38 葫芦娃啊 阅读(329) 评论(0) 推荐(0) 编辑
摘要: import { Link, useLocation, matchRoutes } from 'react-router-dom'; matchRoutes(routes, url); 阅读全文
posted @ 2022-04-06 16:37 葫芦娃啊 阅读(550) 评论(0) 推荐(0) 编辑
摘要: ### git 删除源 删除本地仓库的源 git remote remove origin 添加新的源 git remote add origin ***.git 分支重新关联 git branch --set-upstream-to=origin/master master 同步远程的分支到本地 阅读全文
posted @ 2022-04-06 16:36 葫芦娃啊 阅读(313) 评论(0) 推荐(0) 编辑
摘要: https://app.quicktype.io/ 阅读全文
posted @ 2022-04-06 16:31 葫芦娃啊 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 插件 stylelint 样式格式化 https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint scss Formatter: scss 格式化 https://marketplace.visuals 阅读全文
posted @ 2022-04-06 16:27 葫芦娃啊 阅读(97) 评论(0) 推荐(0) 编辑
摘要: node-sass 依赖下载失败问题解决 修改 npm、yarn、pnpm 下载的源即可,以 yarn 为例 yarn config set sass_binary_site https://mirrors.huaweicloud.com/node-sass/ Npm简介 常见的命令解释:npm i 阅读全文
posted @ 2022-04-06 16:21 葫芦娃啊 阅读(1320) 评论(0) 推荐(0) 编辑
摘要: { "tabWidth": 2, // 使用 tabs 替代空格 "useTabs": false, // 行尾 分号 "semi": true, "singleQuote": true, // props 是否用 引号 包裹 "quoteProps": "as-needed", // 单引号 "j 阅读全文
posted @ 2022-04-06 16:05 葫芦娃啊 阅读(268) 评论(0) 推荐(0) 编辑
摘要: interface Shape { kind: "circle" | "square"; //为了避免错误,规定的字面量类型 radius?: number; sideLength?: number; } function handleShape(shape: Shape) { if (shape. 阅读全文
posted @ 2022-04-06 15:39 葫芦娃啊 阅读(19) 评论(0) 推荐(0) 编辑
摘要: /** * 操作符in 来进行类型缩小 * js中in运算符用来确定对象是否具有某个名称的属性 * 所以ts中也有这个,用来缩小潜在的类型范围 */ //例如“value” in x ,value是字符串文字 x代表联合类型 //true x具有可选或者必需属性的类型的值 //false 分支的缩小 阅读全文
posted @ 2022-04-06 15:37 葫芦娃啊 阅读(4) 评论(0) 推荐(0) 编辑
摘要: //type与interface的拓展 interface Animal { name: string; } interface Tiger extends Animal { age: number; } const tiger: Tiger = { name: "xixi", age: 19 }; 阅读全文
posted @ 2022-04-06 15:36 葫芦娃啊 阅读(4) 评论(0) 推荐(0) 编辑
摘要: //基本类型 string boolean number 字面量 //js文件是由ts文件编译完成的 把js变成静态的 //number 指定a的类型且为字符串类型 后面的赋值只能是指定类型 let a: number; //《方法1》 a = 19; //a = "2121å"; //即使ts写的 阅读全文
posted @ 2022-04-06 15:33 葫芦娃啊 阅读(6) 评论(0) 推荐(0) 编辑
摘要: /** * @file 发电碳排放强度 */ import * as echarts from 'echarts'; import { useEffect, useRef } from 'react'; import { xDataYear } from '.'; interface DataPro 阅读全文
posted @ 2022-04-06 15:19 葫芦娃啊 阅读(207) 评论(0) 推荐(0) 编辑
摘要: /** * * @returns 获取当前月份的前12个月份 */ export const xDataYear = () => { let dataArr = []; let data = new Date(); data.setMonth(data.getMonth() + 1, 1); //获 阅读全文
posted @ 2022-04-06 15:17 葫芦娃啊 阅读(246) 评论(0) 推荐(0) 编辑
摘要: /** * 遍历单位基本信息树 * @param data * @param parentId * @returns */ const getTrees = (data: OrganizationResult[], parentId: number | null) => { let itemArr 阅读全文
posted @ 2022-04-06 15:11 葫芦娃啊 阅读(157) 评论(0) 推荐(0) 编辑
摘要: /** * 处理数字的保留位数 * @param num 要处理的数字 * @param fixNum 保留的小数位数 */ export const sliceNumberEnd = (num: string | number, fixNum?: number) => (+num).toFixed 阅读全文
posted @ 2022-04-06 15:01 葫芦娃啊 阅读(2) 评论(0) 推荐(0) 编辑
摘要: export const getUrlkey = (variable: string) => { var query = window.location.search.substring(1); var vars = query.split('&'); for (var i = 0; i < var 阅读全文
posted @ 2022-04-06 14:59 葫芦娃啊 阅读(58) 评论(0) 推荐(0) 编辑
摘要: export const combineClassName = (...classNames: (string | undefined)[]) => compact(classNames).join(' '); 合并class名字: <div className={combineClassName( 阅读全文
posted @ 2022-04-06 14:57 葫芦娃啊 阅读(40) 评论(0) 推荐(0) 编辑