触控支持

v-touch 指令允许你捕获滑动手势并应用定向回调。

用例

在一个移动设备上,尝试向各个方向滑动。

template script


  1. <template>
  2. <v-row
  3. v-touch="{
  4. left: () => swipe('Left'),
  5. right: () => swipe('Right'),
  6. up: () => swipe('Up'),
  7. down: () => swipe('Down')
  8. }"
  9. align="center"
  10. class="grey lighten-2"
  11. justify="center"
  12. style="height: 500px"
  13. >
  14. <v-subheader>Swipe Direction</v-subheader>
  15. {{ swipeDirection }}
  16. </v-row>
  17. </template>
  1. <script>
  2. export default {
  3. data: () => ({
  4. swipeDirection: 'None',
  5. }),
  6. methods: {
  7. swipe (direction) {
  8. this.swipeDirection = direction
  9. },
  10. },
  11. }
  12. </script>

Touch support(触摸支持) - 图1

API

从下面选择您想要的组件,并查看可用的属性、插槽、事件和函数。

Touch support(触摸支持) - 图2


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)