mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: 修复国际化切换到英文模式刷新会回到中文模式
This commit is contained in:
		
							parent
							
								
									585adefbdd
								
							
						
					
					
						commit
						315f78a825
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
import { useNav } from "./useNav";
 | 
					import { useNav } from "./useNav";
 | 
				
			||||||
import { useI18n } from "vue-i18n";
 | 
					import { useI18n } from "vue-i18n";
 | 
				
			||||||
import { useRoute } from "vue-router";
 | 
					import { useRoute } from "vue-router";
 | 
				
			||||||
import { watch, type Ref } from "vue";
 | 
					import { watch, onBeforeMount, type Ref } from "vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function useTranslationLang(ref?: Ref) {
 | 
					export function useTranslationLang(ref?: Ref) {
 | 
				
			||||||
  const { $storage, changeTitle, handleResize } = useNav();
 | 
					  const { $storage, changeTitle, handleResize } = useNav();
 | 
				
			||||||
@ -27,6 +27,10 @@ export function useTranslationLang(ref?: Ref) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  onBeforeMount(() => {
 | 
				
			||||||
 | 
					    locale.value = $storage.locale?.locale ?? "zh";
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return {
 | 
					  return {
 | 
				
			||||||
    t,
 | 
					    t,
 | 
				
			||||||
    route,
 | 
					    route,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user