Touch evt to listingitem
parent
05884fd12d
commit
8a8ddbec20
|
@ -6,6 +6,7 @@
|
||||||
@drop="drop"
|
@drop="drop"
|
||||||
@click="click"
|
@click="click"
|
||||||
@dblclick="open"
|
@dblclick="open"
|
||||||
|
@touchstart="touchstart"
|
||||||
:aria-selected="isSelected">
|
:aria-selected="isSelected">
|
||||||
<div>
|
<div>
|
||||||
<i class="material-icons">{{ icon }}</i>
|
<i class="material-icons">{{ icon }}</i>
|
||||||
|
@ -32,6 +33,11 @@ import api from '@/utils/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'item',
|
name: 'item',
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
touches: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
props: ['name', 'isDir', 'url', 'type', 'size', 'modified', 'index'],
|
props: ['name', 'isDir', 'url', 'type', 'size', 'modified', 'index'],
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['selected', 'req']),
|
...mapState(['selected', 'req']),
|
||||||
|
@ -115,6 +121,16 @@ export default {
|
||||||
|
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
touchstart (event) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.touches = 0
|
||||||
|
}, 300)
|
||||||
|
|
||||||
|
this.touches++
|
||||||
|
if (this.touches > 1) {
|
||||||
|
this.open()
|
||||||
|
}
|
||||||
|
},
|
||||||
open: function (event) {
|
open: function (event) {
|
||||||
this.$router.push({path: this.url})
|
this.$router.push({path: this.url})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue