diff options
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index de340917b69..204976061df 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -47,12 +47,15 @@ import { Folder, File } from '@nextcloud/files' import { Fragment } from 'vue-fragment' import { join } from 'path' import { translate } from '@nextcloud/l10n' -import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js' import FolderIcon from 'vue-material-design-icons/Folder.vue' +import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js' +import Vue from 'vue' import logger from '../logger' +import { useSelectionStore } from '../store/selection' +import { useFilesStore } from '../store/files' -export default { +export default Vue.extend({ name: 'FileEntry', components: { @@ -72,6 +75,15 @@ export default { }, }, + setup() { + const filesStore = useFilesStore() + const selectionStore = useSelectionStore() + return { + filesStore, + selectionStore, + } + }, + computed: { dir() { // Remove any trailing slash but leave root slash @@ -104,11 +116,11 @@ export default { selectedFiles: { get() { - return this.$store.state.selection.selected + return this.selectionStore.selected }, set(selection) { logger.debug('Added node to selection', { selection }) - this.$store.dispatch('selection/set', selection) + this.selectionStore.set(selection) }, }, }, @@ -121,12 +133,12 @@ export default { * @return {Folder|File} */ getNode(fileId) { - return this.$store.getters['files/getNode'](fileId) + return this.filesStore.getNode(fileId) }, t: translate, }, -} +}) </script> <style scoped lang="scss"> |