- 博客(8)
- 收藏
- 关注
转载 渐变效果只能渲染一个屏,超过一个屏重新渲染的问题
原文链接:https://blog.csdn.net/itSeven7/article/details/71107138background: linear-gradient( #404a59,#0f1319);css背景色可以设置渐变样式,但是这个渐变色只能渲染一屏的大小,超出一屏后会再次渲染 比如下图上面这个图是打开页面之后刚好是渲染了一屏的渐变色,但是,当把页面往下拉之后页面因为超出一屏之后再次渲染了颜色 !解决方法 在body内包一个div,这个div包含所有内容结构,并添
2020-06-10 22:20:48 546
原创 mac端口号占用并解除占用
前提:已经知道占用的端口号,我的是3000;1.首先重新打开一个终端2.输入:lsof -i tcp:3000,会出现:很明显 端口号 3000的程序的 pid号为 750003.在输入:kill 75000这时候在重新运行新的进程就不会出现端口号被占用的信息了。ps:我在输入的时候,lsof -i tcp:3000一直报错,原因是因为:和3000之间不能有空格并且是英文状态下的:...
2020-06-07 19:00:45 648
原创 删除list倒叙删除出现问题,顺序删除没有问题
原代码:<List bordered dataSource={this.props.list} renderItem={(item,index)=>( <List.Item onClick={(index)=>{this.props.deleteItem(index)}}> {item} </List.Item>)}/> 原因:主要是index出现了重新声明的问题。.
2020-06-02 12:38:04 304
原创 Cannot read property map of undefined
原代码:报错信息:TypeError: Cannot read property 'map' of undefinedListUi.rendersrc/Demo1/listUI.jsx:13 10 | {/* ref={input => this.input = input} */} 11 | <input value={this.props.inpValue} onChange={this.props.changeValue} /> 12 | <
2020-06-02 11:42:28 2606
原创 express+node.js 启动后台服务器
前端express+node.js 启动后台服务器需要提前安装好node先新建一个文件夹server,然后打开终端输入cd server 回车npm init npm install express -S在server文件夹下新建一个文件a.js// 引入express模块const express = require("express");// 创建server对象const server = express();// 路由:语法 server.http请求方式(路径/回调函数)
2020-05-16 17:53:56 832
转载 react虚拟dom和diff算法的理解
虚拟dom 虚拟DOM的本质就是一个JS对象,虚拟DOM减少了真实DOM的操作,当修改数据的时候,就是修改虚拟DOM产生全新的虚拟DOM, 新旧虚拟DOM使用diff算法,得到patch(也就是需要修改的部分),然后将这个patch打到浏览器的DOM上 (减少重绘和回流,从而达到性能优化的目的) 每次DOM操作会引起重绘或者回流,频繁的真实DOM的修改会触发多次的排版和重绘相当耗性能 虚拟DOM为什么会提高性能?虚拟DOM提高性能,不是说不操作DOM,而是减少操作DOM的
2020-05-16 09:56:00 229
原创 Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?
在使用antd的时候,根据文档,使用了const [form] = Form.useForm();结果报错报错信息:index.js:1 Warning: Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?原因:官方文档说:这是因为你在调用 form 方法时,Modal 还未初始化导致 form 没有关联任何 Form 组件。你可以通过给 Modal..
2020-05-15 16:56:25 9461 4
转载 react使用antd实现按需打包报错
options has an unknown property ‘source’. These properties are valid@TOC错误信息:Failed to compile./node_modules/antd/es/button/style/index.less (./node_modules/css-loader/dist/cjs.js??ref–6-oneOf-7-1!./node_modules/postcss-loader/src??postcss!./node_module
2020-05-14 14:02:39 678
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人