Skip to content

Commit 4ce6bfe

Browse files
committed
path fix
1 parent 94a7094 commit 4ce6bfe

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-tauri-file-tree",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "A Tauri App"
55
authors = [ "you" ]
66
license = ""

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"package": {
33
"productName": "vue-tauri-file-tree",
4-
"version": "0.2.0"
4+
"version": "0.2.1"
55
},
66
"build": {
77
"distDir": "Set automatically by Vue CLI plugin",

src/App.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
@click="onClick"
1111
@change-name="onChangeName"
1212
@delete-node="onDel"
13-
@dragstart="dragCallback"
1413
@drop="drop"
14+
@drop-before="dropBefore"
1515
:model="data"
1616
v-bind:default-expanded="false"
1717
>
@@ -99,17 +99,20 @@ export default {
9999
}
100100
},
101101
methods: {
102-
dragCallback (event) {
103-
console.log(event)
104-
},
105102
async drop (event) {
106103
const originPath = getFullNodePath(event.src)
107104
const nodeFile = await pathBasename(getFullNodePath(event.node)).then(result => result)
108105
const dest = getFullNodePath(event.target)
109106
const origin = await pathJoin(this.rootDir.trim(), originPath.trim(), nodeFile.trim()).then(result => result)
110107
const target = this.rootDir + dest + DS + nodeFile
108+
console.log(origin, target)
111109
renameFile(origin, target)
112110
},
111+
dropBefore (event) {
112+
const destPath = this.rootDir + getFullNodePath(event.node)
113+
const originPath = this.rootDir + getFullNodePath(event.target) + DS + event.node.name
114+
renameFile(originPath, destPath)
115+
},
113116
async clickUpdateNode () {
114117
await this.updateNode(null, true)
115118
},

0 commit comments

Comments
 (0)