File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { listen } from " @tauri-apps/api/event" ;
2+ import { listen , Event } from " @tauri-apps/api/event" ;
33import { Folder } from " @element-plus/icons-vue" ;
44
55let show = $ref (false );
66
7- listen (" tauri://file-drop-hover" , () => (show = true ));
7+ listen (" tauri://file-drop-hover" , (event : Event <Array <string >>) => {
8+ if (event .payload .length > 0 ) show = true ;
9+ });
810listen (" tauri://file-drop-cancelled" , () => (show = false ));
911listen (" tauri://file-drop" , () => (show = false ));
1012 </script >
1113
1214<template >
13- <div class =" drop-hover" v-if =" show" >
15+ <div class =" drop-hover" v-if =" show" @click = " show = false " >
1416 <div >
1517 <div >
1618 <el-icon size =" 3rem" >
@@ -32,14 +34,14 @@ listen("tauri://file-drop", () => (show = false));
3234 top : 0 ;
3335 left : 0 ;
3436
35- >div {
37+ > div {
3638 height : 100% ;
3739 display : flex ;
3840 justify-content : center ;
3941 align-items : center ;
4042 background-color : var (--el-bg-color );
4143
42- >div {
44+ > div {
4345 margin : 0 auto ;
4446 width : 90vw ;
4547 height : 90vh ;
You can’t perform that action at this time.
0 commit comments