@2alheure/vue-safe-mail 中文文档教程
Vue.js Safe Mail
一个 Vue.js 组件,用于在您的网站上安全地打印您的电子邮件。
这个组件兼容Vue 3。
Description
我们都知道这种情况:你有一个登陆页面,允许人们在页面底部给你发联系信息。
为此,您制作了一个漂亮的表格,并且出于可访问性的目的,您还在其旁边添加了一个带有您的电子邮件地址的链接。
And then it begins…
几十封,甚至几百封邮件! 你很高兴,你在告诉自己“这是我财富的开始!我有很多人想和我聊天!我很高兴”。
但事实证明,在您收到的 100 封电子邮件中,有 99 封来自垃圾邮件机器人,它们读取了您的电子邮件地址并将其出售。
Do not just delete it
别再这样了!
有很多提示可以让您相对安全地显示电子邮件地址。
要点是,不要让机器人按原样获取您的电子邮件地址。 所以人们添加脚本来加密他们的地址。 但是机器人确实会读取生成的 HTML。
因此,如果您只是简单地编写 clear@mail.com
... 这还不够好。
This component
此组件将您的电子邮件地址隐藏在 标记和它的
href
中。
试一试,它会改变你的生活……或者至少你的盒子。^^'
Usage
运行 npm install @2alheure/vue-safe-mail
。 导入它。 使用它。
就这么简单! =D
<SafeMail :email="email" :title="title" />
<script>
import SafeMail from "@2alheure/vue-safe-mail";
export default {
components: {
SafeMail
},
data() {
return {
email: "my.address@email.com",
title: "Click here to send me a nice message which is not spam!"
}
}
};
</script>
它呈现一个 标签,带有指向给定电子邮件的
href
属性……但防止机器人收集。 =P
Props
Name | Type | Default value | Description |
---|---|---|---|
String | null | The email. | |
title | String | null | The title attribute of the generated <a> tag. |
Vue.js Safe Mail
A Vue.js component to safely print your email on your website.
This component is compatible with Vue 3.
Description
We all know this kind of situation: you have a landing page, allowing people to send you a contact message at the bottom of the page.
To do so, you made a nice form, and for accessibility purpose, you also add a link with your email address next to it.
And then it begins…
Dozens, if not hundreds of mails! You're happy, you're telling youself "It's the begining of my fortune! I have plenty of people wanting to chat with me! I'm so happy".
But it turns out that on 100 emails you've got, 99 are from spam bots which read your email address and sold it.
Do not just delete it
Stop undergoing this!
There are plenty of tips allowing you to display an email address relatively safely.
The main point is, not to allow bots to get your email address as is. So people add scripts that encrypt their addresses. But bots do read the HTML generated.
So if you simply write <a htref="mailto:{encryptedmail}">clear@mail.com</a>
… It's not good enough.
This component
This components hides your email address in both the <a>
tag AND its href
.
Just give it a try, it'll change your life… Or at least your box's one.^^'
Usage
Run npm install @2alheure/vue-safe-mail
. Import it. Use it.
It's as simple as that! =D
<SafeMail :email="email" :title="title" />
<script>
import SafeMail from "@2alheure/vue-safe-mail";
export default {
components: {
SafeMail
},
data() {
return {
email: "my.address@email.com",
title: "Click here to send me a nice message which is not spam!"
}
}
};
</script>
It renders a <a>
tag with a href
attribute pointing to the given email… but protected against bots harvest. =P
Props
Name | Type | Default value | Description |
---|---|---|---|
String | null | The email. | |
title | String | null | The title attribute of the generated <a> tag. |