上一页 1 2 3 4 5 6 ··· 11 下一页
摘要: 在next.config.js中,通过配置rewrites fallback来把请求代理到指定域名 module.exports = { ... async rewrites() { return { fallback: [ { source: '/:path*', destination: `ht 阅读全文
posted @ 2022-11-17 17:21 小菜菜爱吃菜 阅读(787) 评论(0) 推荐(0) 编辑
摘要: 项目使用了ts 新建tsconfig.json { "compilerOptions": { ... "paths": { "@/*": ["src/*"] } } } 未使用ts 新建jsconfig.json { "compilerOptions": { ... "paths": { "@/*" 阅读全文
posted @ 2022-11-17 17:20 小菜菜爱吃菜 阅读(333) 评论(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 小菜菜爱吃菜 阅读(71) 评论(0) 推荐(0) 编辑
摘要: useState useState,让函数组件拥有了维持状态的功能。维持状态是指在函数的多次渲染之间,这个state是可以在函数中间共享的 使用方式 import React, { useState } from 'react'; const Counter = () => { const [cou 阅读全文
posted @ 2022-11-17 17:13 小菜菜爱吃菜 阅读(116) 评论(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:20 小菜菜爱吃菜 阅读(465) 评论(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:35 小菜菜爱吃菜 阅读(2083) 评论(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 小菜菜爱吃菜 阅读(1721) 评论(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 小菜菜爱吃菜 阅读(778) 评论(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 小菜菜爱吃菜 阅读(497) 评论(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 小菜菜爱吃菜 阅读(968) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 11 下一页