上一页 1 2 3 4 5 6 ··· 11 下一页
摘要: 项目使用了ts 新建tsconfig.json { "compilerOptions": { ... "paths": { "@/*": ["src/*"] } } } 未使用ts 新建jsconfig.json { "compilerOptions": { ... "paths": { "@/*" 阅读全文
posted @ 2022-11-17 17:20 小菜菜爱吃菜 阅读(535) 评论(0) 推荐(0)
摘要: React class render props mouse-position.js import React, { Component } from 'react' class MousePosition extends Component { constructor(props) { super 阅读全文
posted @ 2022-11-17 17:18 小菜菜爱吃菜 阅读(105) 评论(0) 推荐(0)
摘要: useState useState,让函数组件拥有了维持状态的功能。维持状态是指在函数的多次渲染之间,这个state是可以在函数中间共享的 使用方式 import React, { useState } from 'react'; const Counter = () => { const [cou 阅读全文
posted @ 2022-11-17 17:12 小菜菜爱吃菜 阅读(163) 评论(0) 推荐(0)
摘要: vue3与vite下,element-plus组件库怎么实现按需引入 按需引入意义:减小打包后的包体积 全量引入 // main.js import ElementPlus from 'element-plus'; import 'element-plus/dist/index.css'; impo 阅读全文
posted @ 2022-09-15 18:19 小菜菜爱吃菜 阅读(1199) 评论(0) 推荐(0)
摘要: 在安装了@vitejs/plugin-legacy版本2.x后,运行npm run build进行打包,报错: Cannot destructure property 'renderBuiltUrl' of 'config.experimental' as it is undefined 原因:pl 阅读全文
posted @ 2022-09-15 11:34 小菜菜爱吃菜 阅读(3175) 评论(0) 推荐(0)
摘要: 安装依赖 @vitejs/plugin-legacy 2.x版本,需要vite3.x版本 yarn add @vitejs/plugin-legacy -D 修改vite.config.js相配置 import legacy from '@vitejs/plugin-legacy'; export 阅读全文
posted @ 2022-09-15 11:33 小菜菜爱吃菜 阅读(2241) 评论(0) 推荐(0)
摘要: react18中swiper导致的报错 在nextjs中使用swiperjs,当升级react版本到18.x后,报错: Cannot read properties of undefined (reading 'wrapperClass') 当前版本信息: "next": "^12.1.7-cana 阅读全文
posted @ 2022-06-09 17:57 小菜菜爱吃菜 阅读(1017) 评论(0) 推荐(0)
摘要: 低版本node与swiper版本导致的错误 最近在nextjs项目中使用swiper,版本信息如下: node版本12.9.1 "next": "11.1.0", "swiper": "7.4.1", 项目打包后报错: (node:159) ExperimentalWarning: The ESM 阅读全文
posted @ 2022-06-09 17:25 小菜菜爱吃菜 阅读(619) 评论(0) 推荐(0)
摘要: antd switch 赋值不成功 最近在使用antd switch时,遇到一个意外的问题,switch组件初始化赋值没成功 import React, { useEffect } from 'react'; import { Form, Switch } from 'antd'; const Mo 阅读全文
posted @ 2022-05-20 15:34 小菜菜爱吃菜 阅读(1202) 评论(0) 推荐(0)
摘要: 阶段一: 在早期项目中,整个项目就是一个HTML文件+一个CSS文件+一个js文件 缺点: 整个项目在同一个资源文件中,文件会比较大,初次加载很慢,同时不利于资源的缓存,每次有点改动文件就改变了 一些不使用的功能在初次加载时就加载了,首屏加载慢 错误排查困难 阶段二: 业务与基础框架打包进行分离,类 阅读全文
posted @ 2022-04-28 16:12 小菜菜爱吃菜 阅读(300) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 11 下一页