This commit is contained in:
2020-12-02 00:41:27 +00:00
parent 6e28b2af9d
commit af23293196
8 changed files with 97 additions and 24 deletions

View 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>