摘要: 1.index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="view 阅读全文
posted @ 2022-03-24 17:27 半糖也甜吖 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 1. babel是什么 Babel 是一个 JavaScript 编译器 Babel 是一个工具链,主要用于将采用 ECMAScript 2015+ 语法编写的代码转换为向后兼容的 JavaScript 语法,以便能够运行在当前和旧版本的浏览器或其他环境中。下面列出的是 Babel 能为你做的事情: 阅读全文
posted @ 2022-03-24 17:02 半糖也甜吖 阅读(1506) 评论(0) 推荐(0) 编辑
摘要: import { defineConfig, loadEnv } from 'vite'; import vue from '@vitejs/plugin-vue'; import { resolve } from 'path'; import vueJsx from '@vitejs/plugin 阅读全文
posted @ 2021-11-13 11:06 半糖也甜吖 阅读(1346) 评论(0) 推荐(0) 编辑
摘要: // prettier.config.jsmodule.exports = { /** * @description 尾随逗号 */ trailingComma: 'none', /** * @description 箭头函数 * @example avoid x => x * @example a 阅读全文
posted @ 2021-11-13 11:04 半糖也甜吖 阅读(876) 评论(0) 推荐(0) 编辑
摘要: 1. pnpm: pnpm config set electron_mirror "https://npm.taobao.org/mirrors/electron/" npm: npm config set electron_mirror "https://npm.taobao.org/mirror 阅读全文
posted @ 2021-11-07 10:27 半糖也甜吖 阅读(3730) 评论(0) 推荐(0) 编辑
摘要: 示例: 1 const Home: React.FC = () => { 2 const textRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null); 3 4 useEffect(() => { 5 console.log(textR 阅读全文
posted @ 2021-09-25 10:48 半糖也甜吖 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 1.安装crypto-js npm install crypto-js -S 或 yarn add crypto-js 2.新建解密文件AES.js import CryptoJS from 'crypto-js'; // 密钥 const key = CryptoJS.enc.Utf8.parse 阅读全文
posted @ 2021-05-18 08:18 半糖也甜吖 阅读(1370) 评论(0) 推荐(0) 编辑
摘要: 案例: 父组件引入子组件,在父组件更新内容时,子组件也会重新render import React, { Component } from 'react'; class ChildComponent extends Component { render() { console.log('child 阅读全文
posted @ 2021-05-14 18:42 半糖也甜吖 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" con 阅读全文
posted @ 2021-04-23 09:38 半糖也甜吖 阅读(808) 评论(0) 推荐(0) 编辑
摘要: 1.useReducer 类似redux的reducer 使用: useReducer(fn,initState) 接受两个参数,第一个执行函数,有两个参数,state和action initState为初始数据 useReducer返回一个数组,包含state,dispath action为判断事 阅读全文
posted @ 2021-03-02 09:00 半糖也甜吖 阅读(679) 评论(0) 推荐(0) 编辑