1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-25 00:46:46 +00:00
bramw_baserow/web-frontend/modules/database/components/row/RowEditFieldLinkURL.vue

34 lines
782 B
Vue

<template>
<div class="control__elements">
<a
v-if="isValidLinkURL"
:href="copy && copy.url"
target="_blank"
rel="nofollow noopener noreferrer"
>
{{ labelOrURL }}
</a>
<span v-else>
{{ labelOrURL }}
</span>
</div>
</template>
<script>
import rowEditField from '@baserow/modules/database/mixins/rowEditField'
import rowEditFieldInput from '@baserow/modules/database/mixins/rowEditFieldInput'
import linkURLField from '@baserow/modules/database/mixins/linkURLField'
export default {
mixins: [rowEditField, rowEditFieldInput, linkURLField],
computed: {
isValidLinkURL() {
return this.copy && this.isValid(this.copy)
},
labelOrURL() {
return this.getLabelOrURL(this.copy)
},
},
}
</script>