88 <NcBreadcrumb
99 :name =" t('All files')"
1010 :title =" t('Home')"
11- @click =" emit('update: path', '/') " >
11+ @click =" path = '/'" >
1212 <template #icon >
1313 <IconHome :size =" 20" />
1414 </template >
1818 :key =" dir.path"
1919 :name =" dir.name"
2020 :title =" dir.path"
21- @click =" emit('update: path', dir.path) " />
21+ @click =" path = dir.path" />
2222 </template >
2323 <template v-if =" showMenu " #actions >
2424 <NcActions
2525 v-model:open =" actionsOpen"
2626 :aria-label =" t('Create directory')"
27- :force-menu =" true"
28- :force-name =" true"
29- :menu-name =" t('New')"
27+ :forceMenu =" true"
28+ :forceName =" true"
29+ :menuName =" t('New')"
3030 variant =" secondary"
3131 @close =" newNodeName = ''" >
3232 <template #icon >
3838 :label =" t('New folder')"
3939 :placeholder =" t('New folder name')"
4040 @submit =" onSubmit"
41- @update:model-value =" validateInput" >
41+ @update:modelValue =" validateInput" >
4242 <template #icon >
4343 <IconFolder :size =" 20" />
4444 </template >
@@ -60,22 +60,19 @@ import IconHome from 'vue-material-design-icons/Home.vue'
6060import IconPlus from ' vue-material-design-icons/Plus.vue'
6161import { t } from ' ../../utils/l10n.ts'
6262
63- const props = defineProps <{
64- /** Current path to display */
65- path: string
63+ /** Current path to display */
64+ const path = defineModel <string >(' path' , { required: true })
65+
66+ defineProps <{
6667 /** Whether to show the "new node" menu or not */
67- showMenu: boolean
68+ showMenu? : boolean
6869}>()
6970
7071const emit = defineEmits <{
71- /**
72- * Triggered when the path was changed by using the breadcrumbs
73- */
74- (e : ' update:path' , path : string ): void
7572 /**
7673 * Triggered when a new directory on the current path should be created
7774 */
78- ( e : ' create-node ' , name : string ) : void
75+ createNode : [ name : string ]
7976}>()
8077
8178const actionsOpen = ref (false )
@@ -129,15 +126,15 @@ function onSubmit() {
129126
130127 if (validateInput ()) {
131128 actionsOpen .value = false
132- emit (' create-node ' , name )
129+ emit (' createNode ' , name )
133130 newNodeName .value = ' '
134131 }
135132}
136133
137134/**
138135 * Split current path and provide the path and the basename
139136 */
140- const pathElements = computed (() => props . path .split (' /' )
137+ const pathElements = computed (() => path . value .split (' /' )
141138 .filter ((v ) => v !== ' ' )
142139 .map ((v , i , elements ) => ({
143140 name: v ,
0 commit comments