sanitize-email
A directive developed with Vue.js that sanitizes the entered email address reactively.
537
1
| Install | |
|---|---|
npm install sanitize-email |
|
| Latest Version: | 0.0.7 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | May 7, 2023 |
| Links: | GitHub · npm |
Maintainer: mustafadalga
Sanitize Email Directive
- A directive developed with Vue.js that sanitizes the entered email address reactively.
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
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.0.7 | ^3.2.47 | MIT | |
| 0.0.6 | ^3.2.47 | MIT | |
| 0.0.5 | ^3.2.47 | MIT | |
| 0.0.4 | ^3.2.47 | MIT | |
| 0.0.3 | ^3.2.47 | MIT | |
| 0.0.2 | ^3.2.47 | MIT | |
| 0.0.1 | ^3.2.47 | MIT | |
| 0.0.0 | ^3.2.47 | MIT |