1. Button definition:
2. Introducing an external JS file (a file that encapsulates the Ajax method): Note The directory structure
3. Invoke the specific method in the Ajax file:
4. Writing syntax for methods in AJAX files:
Writing one:
Two:
Two corresponding calls to the method's notation:
# #var Mongoose = Module.exports = exports = new Mongoose;
The difference between export, import and export default in 5.ES6:
Export and export default can be used for exporting constants, functions, files, modules, etc., you can import them in other files or modules by import+ (constant | function | file | module) name, so that they can be used, but in a file or module, Export, import can have multiple, export default only one.
6. Key step: React gets the data for the page Dom (Input):
(1) Button binding event:
(2) Bind different onchange functions to different input boxes:
(3) To write different input boxes corresponding to the different state change function, the purpose is to different input boxes corresponding to different parameters:
(4) The event function that submits the button binding can invoke different state parameters:
2017.11.30 Reat Data interaction of the front and back of the button commit processing (AJAX methods are packaged separately as APIs without a form)