mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: 修复iframe加载失败
				
					
				
			This commit is contained in:
		
							parent
							
								
									3baffa11e4
								
							
						
					
					
						commit
						30c682bd24
					
				@ -235,12 +235,15 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
 | 
				
			|||||||
    // 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值
 | 
					    // 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值
 | 
				
			||||||
    if (v?.children && v.children.length && !v.name)
 | 
					    if (v?.children && v.children.length && !v.name)
 | 
				
			||||||
      v.name = v.children[0].name;
 | 
					      v.name = v.children[0].name;
 | 
				
			||||||
    if (v.meta?.frameSrc) v.component = IFrame;
 | 
					    if (v.meta?.frameSrc) {
 | 
				
			||||||
    // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致)
 | 
					      v.component = IFrame;
 | 
				
			||||||
    const index = v?.component
 | 
					    } else {
 | 
				
			||||||
      ? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any))
 | 
					      // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致)
 | 
				
			||||||
      : modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
 | 
					      const index = v?.component
 | 
				
			||||||
    v.component = modulesRoutes[modulesRoutesKeys[index]];
 | 
					        ? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any))
 | 
				
			||||||
 | 
					        : modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
 | 
				
			||||||
 | 
					      v.component = modulesRoutes[modulesRoutesKeys[index]];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (v?.children && v.children.length) {
 | 
					    if (v?.children && v.children.length) {
 | 
				
			||||||
      addAsyncRoutes(v.children);
 | 
					      addAsyncRoutes(v.children);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user