const {test}=result.data  
  this.info=test.info                                    - 发布:2021-02-18 11:18
 - 更新:2021-04-22 10:25
 - 阅读:1671
 
产品分类: HbuilderX
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10 20H2
HBuilderX版本号: 3.1.2
示例代码:
                                    
                                    
                                         
                                
                                                                                                操作步骤:
                                    
                                          const {test}=result.data  
  this.info=test.info
                                     
                                
                                                                                                  const {test}=result.data  
  this.info=test.info                                    预期结果:
                                    
                                    
                                          const {test}=result.data  
  this.info=test.info
                                     
                                
                                                                                                  const {test}=result.data  
  this.info=test.info                                    实际结果:
                                    
                                    
                                          const {test}=result.data,  
  this.info=test.info
                                     
                                
                                                              const {test}=result.data,  
  this.info=test.info                                    
            
            
            
            
l***@126.com (作者)
写一个简单的代码就可以复现
比如 const test={a:1,b:2,c:3,d:4}
const {a:e,b,c,d}=test
console.log(e)
这个代码敲一遍就会发现在第二行自动添加了逗号
2021-02-18 17:39