摘要: <button class="btn" id="pass">批量通过</button> 问题原因:火狐浏览器中,button按钮默认类型为submit,会已form表单的形式提交。通过指定type为button即可 <button class="btn" type="button" id="pass 阅读全文
posted @ 2023-01-05 15:27 小菜菜爱吃菜 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 通过添加meta标签来控制页面缩放 <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, min 阅读全文
posted @ 2023-01-05 15:21 小菜菜爱吃菜 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 在新版react中,develop环境中,严格模式(React.StrictMode)下会重复渲染两次的问题,在正式环境中不会重复渲染 issue 带来的问题: 接口会重复调用,在有些场景下重复调用接口会导致报错,develop下调试时带来不便 解决方案: 手动关闭严格模式,即不使用React.St 阅读全文
posted @ 2023-01-05 15:12 小菜菜爱吃菜 阅读(938) 评论(0) 推荐(0) 编辑
摘要: braft-editor中使用了浏览器对象window等,在next中使用时会报window is not defined相关错误 解决方案: src/home/conponents/editor/index.js import React from 'react'; // 引入编辑器组件 impo 阅读全文
posted @ 2023-01-05 14:58 小菜菜爱吃菜 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 在es模块中使用__dirname时,会报错 The "__dirname is not defined in ES module scope" error occurs when we try to try to use the __dirname global variable in an ES 阅读全文
posted @ 2022-11-17 17:55 小菜菜爱吃菜 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 获取上次合并代码的id git reflog 回滚代码 git reset --hard id 阅读全文
posted @ 2022-11-17 17:53 小菜菜爱吃菜 阅读(386) 评论(0) 推荐(0) 编辑
摘要: antd安装启动后报错Variable @primary-color-hover is undefined 报错前package.json中依赖版本信息: "dependencies": { ... "@ant-design/pro-form": "^1.15.1", "@ant-design/pr 阅读全文
posted @ 2022-11-17 17:25 小菜菜爱吃菜 阅读(891) 评论(0) 推荐(0) 编辑
摘要: const App = () => { const value = `例子:\n今天天气不错`; const value1 = `例子:\r今天天气不错`; return ( <> <TextArea placeholder="例子:&#13;&#10;今天天气不错" style={{ height 阅读全文
posted @ 2022-11-17 17:24 小菜菜爱吃菜 阅读(671) 评论(0) 推荐(0) 编辑
摘要: 在https://www.ipaddress.com输入443的网站,获取域名对应IP 编辑电脑hosts文件: 140.82.112.3 github.com 阅读全文
posted @ 2022-11-17 17:23 小菜菜爱吃菜 阅读(2117) 评论(0) 推荐(0) 编辑
摘要: 问题原因,nextjs是服务端渲染的,在服务器预渲染HTML,然后发送到客户端进行渲染。因此在服务端渲染时,是获取不到浏览器对象window/document等 dynamic 动态导入组件 home.js export default Home () { console.log(window); 阅读全文
posted @ 2022-11-17 17:22 小菜菜爱吃菜 阅读(846) 评论(0) 推荐(0) 编辑