Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

sanitize-email

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanitize-email

A directive developed with Vue.js that sanitizes the entered email address reactively.

latest
Source
npmnpm
Version
0.0.7
Version published
Weekly downloads
3
-40%
Maintainers
1
Weekly downloads
 
Created
Source

Sanitize Email Directive

  • A directive developed with Vue.js that sanitizes the entered email address reactively.

vue version vue version

Installing

Package manager

Using npm:

npm i sanitize-email

Then, import and register the component:

Global Registration

main.js

import sanitizeEmail from "sanitize-email";
app.use(sanitizeEmail);

Local Registration

  • Composition API
<script setup>
import { sanitizeEmail as vSanitizeEmail } from "sanitize-email";
</script>
  • Options API
<script>
import { sanitizeEmail } from "sanitize-email";

export default {
  directives: {
    "sanitize-email": sanitizeEmail
  },
}
</script>

Usage

  • Example 1
<script>
import { sanitizeEmail } from "sanitize-email";

export default {
  directives: {
    "sanitize-email": sanitizeEmail
  },
  data () {
    return {
       email: ""
    }
  }
}
</script>

<template>
      <input v-sanitize-email="email"
             v-model="email"
              type="text" />
</template>
  • Example 2
<script setup>
import { sanitizeEmail as vSanitizeEmail } from "sanitize-email";
import { ref } from "vue";
const email = ref("");
</script>

<template>
      <input v-sanitize-email="email"
             v-model="email"
              type="text" />
</template>
  • Example 3
<script setup>
import { ref } from "vue";
const email = ref("");
</script>

<template>
      <input v-sanitize-email="email"
             v-model="email"
              type="text" />
</template>
  • Example 4
<script>
export default {
  data() {
    return {
      email: ""
    }
  }
}
</script>

<template>
  <input v-sanitize-email="email" v-model="email" type="text" />
</template>

Demo

License

License

Keywords

sanitize-email

FAQs

Package last updated on 07 May 2023

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