upgrade to tauri 2.2.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
// import { listen } from '@tauri-apps/api/event';
|
||||
import { open } from '@tauri-apps/plugin-dialog';
|
||||
import { sep } from '@tauri-apps/api/path';
|
||||
import { basename } from '@tauri-apps/api/path';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
import Icon from './Icon.svelte';
|
||||
@@ -14,17 +14,16 @@
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
async function chooseFile() {
|
||||
let file = await open(params);
|
||||
if (file) {
|
||||
value = file;
|
||||
displayValue = file.name;
|
||||
let path = await open(params);
|
||||
if (path) {
|
||||
displayValue = await basename(path);
|
||||
value = {name: displayValue, path};
|
||||
dispatch('update', value);
|
||||
}
|
||||
}
|
||||
|
||||
function handleInput(evt) {
|
||||
const segments = evt.target.value.split(sep());
|
||||
const name = segments[segments.length - 1];
|
||||
async function handleInput(evt) {
|
||||
const name = await basename(evt.target.value);
|
||||
value = {name, path: evt.target.value};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user