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.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
79
increased by46.3%
Maintainers
4
Weekly downloads
 
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 16 Dec 2021

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