触控支持
v-touch
指令允许你捕获滑动手势并应用定向回调。
用例
在一个移动设备上,尝试向各个方向滑动。
template script
<template>
<v-row
v-touch="{
left: () => swipe('Left'),
right: () => swipe('Right'),
up: () => swipe('Up'),
down: () => swipe('Down')
}"
align="center"
class="grey lighten-2"
justify="center"
style="height: 500px"
>
<v-subheader>Swipe Direction</v-subheader>
{{ swipeDirection }}
</v-row>
</template>
<script>
export default {
data: () => ({
swipeDirection: 'None',
}),
methods: {
swipe (direction) {
this.swipeDirection = direction
},
},
}
</script>
API
从下面选择您想要的组件,并查看可用的属性、插槽、事件和函数。
Alpha Theme
Complete theme experience including enhanced Vue CLI, full documentation, 5 custom components and much more!
ads by Vuetify
](https://store.vuetifyjs.com/product/alpha-theme?ref=vuetifyjs.com)