fix: refs #6891 Optimize RightMenu component rendering
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
e6f0e6b089
commit
f55e9d7c32
|
@ -9,14 +9,13 @@ const rightPanel = ref(null);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
rightPanel.value = document.querySelector('#right-panel');
|
rightPanel.value = document.querySelector('#right-panel');
|
||||||
if (rightPanel.value.childNodes.length) hasContent.value = true;
|
if (!rightPanel.value) return;
|
||||||
|
|
||||||
// Check if there's content to display
|
// Check if there's content to display
|
||||||
const observer = new MutationObserver(() => {
|
const observer = new MutationObserver(() => {
|
||||||
hasContent.value = rightPanel.value.childNodes.length;
|
hasContent.value = rightPanel.value.childNodes.length;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (rightPanel.value)
|
|
||||||
observer.observe(rightPanel.value, {
|
observer.observe(rightPanel.value, {
|
||||||
subtree: true,
|
subtree: true,
|
||||||
childList: true,
|
childList: true,
|
||||||
|
|
Loading…
Reference in New Issue