@@ -191,18 +191,20 @@ const loading = ref(false)
191191
192192const tableData = ref ([])
193193
194- const currentPath = ref (' sdcard' )
194+ const currentPath = ref (' / sdcard' )
195195
196196const presetMap = {
197197 sdcard: {
198198 icon: ' Iphone' ,
199199 label: ' device.control.file.manager.storage' ,
200- value: ' sdcard' ,
200+ value: ' / sdcard' ,
201201 },
202202}
203203
204204const breadcrumbModel = computed (() => {
205- const list = currentPath .value .split (' /' )
205+ const slicePath = currentPath .value .slice (1 )
206+
207+ const list = slicePath ? slicePath .split (' /' ) : [' /' ]
206208
207209 const value = list .map (item => ({
208210 label: item,
@@ -243,7 +245,7 @@ function onSelectionChange(selection) {
243245const scrollableRef = ref ()
244246
245247async function handleDirectory (row ) {
246- currentPath .value += ` / ${ row .name } `
248+ currentPath .value = row .id
247249 getTableData ()
248250
249251 await nextTick ()
@@ -259,14 +261,14 @@ function handleBreadcrumb(data) {
259261}
260262
261263function handlePrev () {
262- if (breadcrumbModel .value .length <= 1 ) {
263- return false
264- }
264+ let value = ' /'
265265
266- const value = breadcrumbModel .value
267- .slice (0 , - 1 )
268- .map (item => item .value )
269- .join (' /' )
266+ if (breadcrumbModel .value .length > 1 ) {
267+ value = breadcrumbModel .value
268+ .slice (0 , - 1 )
269+ .map (item => item .value )
270+ .join (' /' )
271+ }
270272
271273 currentPath .value = value
272274
@@ -298,7 +300,7 @@ async function handleRemove(row) {
298300
299301 await window .adb .deviceShell (
300302 device .value .id ,
301- ` rm -r "/ ${ currentPath .value } /${ row .name } "` ,
303+ ` rm -r "${ currentPath .value } /${ row .name } "` ,
302304 )
303305
304306 getTableData ()
@@ -307,7 +309,7 @@ async function handleRemove(row) {
307309async function handleUpload (device , openType ) {
308310 await fileActions .send (device, {
309311 openType,
310- remotePath: ` / ${ currentPath .value } ` ,
312+ remotePath: currentPath .value ,
311313 })
312314
313315 getTableData ()
0 commit comments