New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

v2-touch

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v2-touch

A full-featured gesture component designed for Vue

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

v-touch

A full-featured gesture component designed for Vue

This module is still working in progress right now, so it is just for placeholder.

Now, you can try to use v-touch in your project!

Usage

A deadly simply example:

see this on jsfiddle

If you are also working with vue-touch, you can use Vue.use(VTouch, {name: 'move'}) (or something else), so that the directive name will change to v-move!

new Vue({
  el: '#app',
  template: `<div class="container">
  tap: {{ tapNum }},<br>
  dblTap: {{ dblTapNum }},<br>
  mltTap: {{ mltTapNum }}, lastMltTapped: {{ lastMltTapped }}<br>
  press: {{ pressNum }},<br>
  swipeLeft: {{ swipeLeftNum }},<br>
  swipeRight: {{ swipeRightNum }},<br>
  swipeUp: {{ swipeUpNum }},<br>
  swipeDown: {{ swipeDownNum }}
  <br>
  <div v-touch="touch" @dblclick="dblclickOuter">
    <button class="my-btn" @tap="click">{{ msg }}</button>
    <div @dblclick="dblclick">
      <button class="my-btn">Just Another Button</button>
    </div>
  </div>
  <br>
  <br>
  <button class="btn btn-default" @click="toggle('x')">toggle x ({{ x }})</button>
  <button class="btn btn-default" @click="toggle('y')">toggle y ({{ y }})</button>
</div>`,
  data() {
      return {
        msg: 'try to touch, move, swipe, press me!',
        x: false,
        y: false,
        tapNum: 0,
        dblTapNum: 0,
        mltTapNum: 0,
        lastMltTapped: 0,
        pressNum: 0,
        swipeLeftNum: 0,
        swipeRightNum: 0,
        swipeUpNum: 0,
        swipeDownNum: 0
      }
    },
    computed: {
      touch() {
        return {
          x: this.x,
          y: this.y,
          methods: true
        }
      }
    },
    methods: {
      toggle(prop) {
        this[prop] = !this[prop]
      },
      tap(e) {
        this.tapNum++
      },
      dblTap() {
        this.dblTapNum++
      },
      mltTap({tapped}) {
        this.mltTapNum++
        this.lastMltTapped = tapped
      },
      press() {
        this.pressNum++
      },
      swipeLeft() {
        this.swipeLeftNum++
      },
      swipeRight() {
        this.swipeRightNum++
      },
      swipeUp() {
        this.swipeUpNum++
      },
      swipeDown() {
        this.swipeDownNum++
      },
      click() {
        console.log('clicked the first button')
      },
      dblclick() {
        console.log('dblclicked the second one')
      },
      dblclickOuter() {
        console.log('dblclicked')
      }
    }
})

Document

[WIP]

Keywords

vue

FAQs

Package last updated on 19 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts