Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nanogiants/vue3-longpress

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nanogiants/vue3-longpress

This package contains a Vue 3 directive which adds the `@longpress` event to an element.

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

vue3-longpress

This package contains a Vue 3 directive which adds the @longpress event to an element.

Installation

npm i @nanogiants/vue3-longpress
# or
yarn add @nanogiants/vue3-longpress

Usage

// main.ts file
import { vLongpress } from '@nanogiants/vue3-longpress';
import App from './App.vue';

const app = createApp(App);
app.directive('use-longpress', vLongpress);


// component.ts
<template>
  <div>
    <div v-use-longpress="500" @longpress="onLongpress">Hello World!</div>
    <div v-use-longpress @longpress="onLongpress">Hello World!</div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
  setup() {
    const onLongpress = (e: CustomEvent) => {
      console.log('onLongpress', e);
    };
    return { onLongpress };
  },
});
</script>

args

There is only one arg you can pass.
The duration can be set as an interger in ms. Default is 500.

<div v-use-longpress="1000" @longpress="onLongpress"></div>

License

MIT

Keywords

FAQs

Package last updated on 21 Jan 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc