The experience of entering the project for the first time during the internship

The experience of entering the project for the first time during the internship

The internship is about 2 months. I entered the project for the first time and talked about my personal experience. The instructor asked to complete a sub-page.
Use react and hook to complete the page production
. The process of writing a page (representing personal views only):
1. Get the page you want to write first The idea of ​​conceiving the entire page, the text to be used must have corresponding English words (for writing className)
2. Before writing, the instructor will give a rough framework, because it is the first time to write, just follow that writing, first When writing return, return is written in html, which is easier to understand. It is also something that you just learned from the front-end entry. The framework is better to write. The style is the same as before.
3. The code written is in
useEffect. (() => { return componentDid(); }, []); useEffect( () => () => { return componentWillUn(); }, [], ); is done inside, these two are react Life cycle 4. The components in antd will definitely be used, antd is full of some shaped samples, copy the required code and use it, you need to include the package 5. After that, the html part that is written will be used Methods and some variables, variables need to be declared at the top, for example: const [alarmLevelList, setAlarmLevelList] = useState([]);












6. The first time the instructor will write a control class, that is, some methods and data sources (because it is not connected to the service yet, some dummy data will be given). The data is obtained by looking at the parameters in the control class. You are here There are a few parameters, and then there are some click events, written in es6, and each method has a callback function at the end. You must write a method name +Completed, which will perform the operation you will perform after you click it. The rest is the logic of your page, where to do it, my page needs to be refreshed, you can write a clear function, at the beginning to initialize.
Generally speaking, the logic of the page is not difficult, the difficulty is that there are ideas code Can't write

Guess you like

Origin blog.csdn.net/qq_49975871/article/details/114402590