aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-12 08:44:26 +0800
committerGitHub <noreply@github.com>2023-04-11 20:44:26 -0400
commit6892e2b8efff4465acd702e702d16f7aadd07187 (patch)
treef29fdbd56f7bcb79127eed8f09c4ee69917a0172 /web_src/js/modules
parent1380b873115c85ca9e758789b0757ae5a6610a1e (diff)
downloadgitea-6892e2b8efff4465acd702e702d16f7aadd07187.tar.gz
gitea-6892e2b8efff4465acd702e702d16f7aadd07187.zip
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>
Diffstat (limited to 'web_src/js/modules')
-rw-r--r--web_src/js/modules/stores.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/web_src/js/modules/stores.js b/web_src/js/modules/stores.js
new file mode 100644
index 0000000000..24b913ce11
--- /dev/null
+++ b/web_src/js/modules/stores.js
@@ -0,0 +1,5 @@
+import {reactive} from 'vue';
+
+export const DiffTreeStore = reactive({
+ selectedItem: '',
+});