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/view/grid/fields/FunctionalGridViewFieldButton.vue
2024-04-15 11:29:17 +00:00

30 lines
811 B
Vue

<template functional>
<div ref="cell" class="grid-view__cell" :class="data.staticClass || ''">
<div class="grid-field-button">
<Button
v-if="$options.methods.isValid(props.value)"
tag="a"
type="secondary"
size="tiny"
:href="props.value && props.value.url"
target="_blank"
rel="nofollow noopener noreferrer"
>
{{ $options.methods.getLabelOrURL(props.value) }}
</Button>
<Button v-else tag="a" type="secondary" size="tiny" disabled>
{{ $options.methods.getLabelOrURL(props.value) }}
</Button>
</div>
</div>
</template>
<script>
import linkURLField from '@baserow/modules/database/mixins/linkURLField'
export default {
name: 'FunctionalGridViewFieldButton',
mixins: [linkURLField],
}
</script>