03 dynamic display tabular data

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 6     <title>Document</title>
 7     <script src="../js/react.development.js"></script>
 8     <script src="../js/react-dom.development.js"></script>
 9     <Script the src = " ../js/babel.min.js " > </ Script>
 10 </ head>
 . 11 <body>
 12 is  
13 is      <div ID = " Box " > </ div>
 14  
15      <Script type = " text / Babel " >
 16         // dynamic display list data 
. 17          var LIS = [ ' the jQuery ' , ' zeptoo ' , ' the Angular ' , ' REACT ' , 'view ' , 'Ajax ' ];
 18 is          var Vul = (
 . 19              <UL>
 20 is              {
 21 is                lis.map ((Li, index, LIS) => <Li Key index = {}> {Li} </ Li>) // use the map method converting the array to a data array of a tag 
22 is              }
 23 is              </ UL>
 24          )
 25          ReactDOM.render (Vul, document.getElementById ( " Box " ));
 26 is      
27      </ Script>
 28 </ body>
 29 < / html>
map array of methods
1, map () method returns a new array, a new array element calls a function value obtained for the original processing each element of the array.
2, map () method in the original order of the processing elements in the array elements.
3, action map () is a function of each element in the array for processing and returns to the new element.
4, Syntax: array.map (function (item, index, arr []));
5, map array method, there is a parameter, the parameter is a function, the function has three parameters.
Parameter 1, item must be, the value of the current element; parameter 2, index, alternatively, the index value of the current element in the array; parameter 3, arr Alternatively, the array elements belonging to the object of the current

 

 

Guess you like

Origin www.cnblogs.com/shanlu0000/p/12483980.html