mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Use reactive store to share data between components (#23996)
Follow #23947 * Use reactive store to share data between components * Remove no-op `this.hashListener = window.addEventListener()` because `addEventListener` returns void/undefined. Reference: https://vuejs.org/guide/scaling-up/state-management.html#simple-state-management-with-reactivity-api Screenshot (the same as before): <details> <img width="565" alt="image" src="https://user-images.githubusercontent.com/2114189/230701282-bd61bfa3-7786-433b-9ad8-a88591112a02.png"> </details> --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
		
							
								
								
									
										5
									
								
								web_src/js/modules/stores.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								web_src/js/modules/stores.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
import {reactive} from 'vue';
 | 
			
		||||
 | 
			
		||||
export const DiffTreeStore = reactive({
 | 
			
		||||
  selectedItem: '',
 | 
			
		||||
});
 | 
			
		||||
		Reference in New Issue
	
	Block a user