remove watch to make more lightweight

This commit is contained in:
joshuaboud 2022-06-13 17:34:08 -03:00
parent 6b201edc55
commit 3f3e5b1da8
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E

View File

@ -81,7 +81,7 @@
</template>
<script>
import { ref, inject, watch, nextTick, onBeforeUnmount, onMounted, onActivated, onDeactivated } from 'vue';
import { ref, inject, watch, nextTick, onBeforeUnmount, onMounted, onActivated, onDeactivated, onUpdated } from 'vue';
import { DocumentIcon, FolderIcon, LinkIcon, DocumentRemoveIcon, ArrowNarrowRightIcon, XIcon, ChevronDownIcon, ChevronUpIcon } from '@heroicons/vue/solid';
import { settingsInjectionKey } from '../keys';
import DirectoryEntryList from './DirectoryEntryList.vue';
@ -119,8 +119,6 @@ export default {
const directoryEntryListRef = ref();
const selectIntersectElement = ref();
// const selectedClasses = ref([]);
if (props.entry.type === 'd' || (props.entry.type === 'l' && props.entry.target?.type === 'd')) {
icon.value = FolderIcon;
directoryLike.value = true;
@ -158,9 +156,11 @@ export default {
}
onMounted(() => {
watch(selectIntersectElement, () =>
emit('setEntryProp', 'DOMElement', selectIntersectElement.value), { immediate: true }
);
emit('setEntryProp', 'DOMElement', selectIntersectElement.value);
})
onUpdated(() => {
emit('setEntryProp', 'DOMElement', selectIntersectElement.value);
});
onBeforeUnmount(() => {