mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-25 00:46:46 +00:00
37 lines
897 B
Vue
37 lines
897 B
Vue
<template>
|
|
<div class="control__elements">
|
|
<Button
|
|
v-if="isValidLinkURL"
|
|
tag="a"
|
|
size="tiny"
|
|
type="secondary"
|
|
:href="copy && copy.url"
|
|
target="_blank"
|
|
rel="nofollow noopener noreferrer"
|
|
>
|
|
{{ labelOrURL }}
|
|
</Button>
|
|
<Button v-else tag="a" size="tiny" type="secondary" disabled>
|
|
{{ labelOrURL }}
|
|
</Button>
|
|
</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>
|