1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-04 09:37:19 +00:00

Use shallowRef instead of ref in .vue files where possible (#34813)

This PR improves some `.vue` components by using `shallowRef instead of
ref`, which `should improve performance`. It's probably not significant,
but it's an improvement because Vue no longer deep watches the ref
(shallowRef). Also i used `useTemplateRef` instead of `ref`.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Kilisei
2025-06-22 15:37:03 +02:00
committed by GitHub
parent a46b16f10f
commit 181db69e0c
9 changed files with 51 additions and 51 deletions

View File

@ -1,9 +1,9 @@
<script lang="ts" setup>
import ViewFileTreeItem from './ViewFileTreeItem.vue';
import {onMounted, ref} from 'vue';
import {onMounted, useTemplateRef} from 'vue';
import {createViewFileTreeStore} from './ViewFileTreeStore.ts';
const elRoot = ref<HTMLElement | null>(null);
const elRoot = useTemplateRef('elRoot');
const props = defineProps({
repoLink: {type: String, required: true},