This commit is contained in:
25
ayanova/src/components/email-control.vue
Normal file
25
ayanova/src/components/email-control.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<v-text-field
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
type="email"
|
||||
prepend-icon="$ayiAt"
|
||||
@click:prepend="openUrl"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
openUrl() {
|
||||
if (
|
||||
this.$el &&
|
||||
this.$el.attributes &&
|
||||
this.$el.attributes.value &&
|
||||
this.$el.attributes.value.value
|
||||
) {
|
||||
window.open(`mailto:${this.$el.attributes.value.value}`, "email");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -4,17 +4,21 @@
|
||||
v-on="$listeners"
|
||||
type="tel"
|
||||
prepend-icon="$ayiPhoneAlt"
|
||||
@click:prepend="dial"
|
||||
@click:prepend="openUrl"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
dial() {
|
||||
console.log(this.$el.attributes.value);
|
||||
//alert("DIAL");
|
||||
openUrl() {
|
||||
if (
|
||||
this.$el &&
|
||||
this.$el.attributes &&
|
||||
this.$el.attributes.value &&
|
||||
this.$el.attributes.value.value
|
||||
) {
|
||||
window.open(`tel:${this.$el.attributes.value.value}`, "phone");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
27
ayanova/src/components/url-control.vue
Normal file
27
ayanova/src/components/url-control.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<v-text-field
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
type="url"
|
||||
prepend-icon="$ayiExternalLinkAlt"
|
||||
@click:prepend="openUrl"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
openUrl() {
|
||||
if (
|
||||
this.$el &&
|
||||
this.$el.attributes &&
|
||||
this.$el.attributes.value &&
|
||||
this.$el.attributes.value.value
|
||||
) {
|
||||
let link = this.$el.attributes.value.value;
|
||||
link = link.indexOf("://") === -1 ? "//" + link : link;
|
||||
window.open(link, "_blank");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user