mock 을 이용 하여 무 작위 물건 을 생 성 합 니 다.

 1 Mock.mock({
 2     "list|100": [
 3         {
 4             'id|+1': 1,//id  
 5 
 6             'color': '@color()',//    
 7 
 8             'date': '@datetime()',//    
 9 
10             'img': '@image()',//    
11 
12             'url': '@url(http)',//  url  
13 
14             'email': '@email()',//  email
15 
16             'name': "@name(1,2)",//      

           name:"@cname",  //무 작위 중국어 이름
18             'text': '@paragraph()',//      
19             'title':'@ctitle',//      
20             'city':'@county(true)',//      
21             'price': '@integer(100,2000)'//    
22         }
23     ]
24 })

 http://mockjs.com/examples.html#Random.cparagraph(%20min?,%20max?%20) 
이 사이트 안의 것 은 더욱 완전 하 다.
다음으로 전송:https://www.cnblogs.com/cq1715584439/p/10853302.html

좋은 웹페이지 즐겨찾기