mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
add hidden state for file in animation
This commit is contained in:
@@ -26,7 +26,8 @@
|
|||||||
ref="fileImg"
|
ref="fileImg"
|
||||||
:class="{
|
:class="{
|
||||||
'swing': state === 'dragover',
|
'swing': state === 'dragover',
|
||||||
'fly': state === 'drop'
|
'fly': state === 'dropping',
|
||||||
|
'hidden': state === 'dropped'
|
||||||
}"
|
}"
|
||||||
:src="require('@/assets/images/file.png')"
|
:src="require('@/assets/images/file.png')"
|
||||||
/>
|
/>
|
||||||
@@ -196,6 +197,7 @@ export default {
|
|||||||
this.animationPromise = new Promise((resolve) => {
|
this.animationPromise = new Promise((resolve) => {
|
||||||
this.$refs.fileImg.addEventListener('animationend', event => {
|
this.$refs.fileImg.addEventListener('animationend', event => {
|
||||||
if (event.animationName.startsWith('fly')) {
|
if (event.animationName.startsWith('fly')) {
|
||||||
|
this.state = 'dropped'
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -387,7 +389,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async checkFile (file) {
|
async checkFile (file) {
|
||||||
this.state = 'drop'
|
this.state = 'dropping'
|
||||||
if (csvMimeTypes.includes(file.type)) {
|
if (csvMimeTypes.includes(file.type)) {
|
||||||
this.file = file
|
this.file = file
|
||||||
this.header = true
|
this.header = true
|
||||||
@@ -519,6 +521,11 @@ export default {
|
|||||||
left: 225px;
|
left: 225px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#file-img.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* Parse CSV dialog */
|
/* Parse CSV dialog */
|
||||||
.chars {
|
.chars {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user