feat(BaseButton): add target _blank for links by default
This commit is contained in:
parent
12544c52ca
commit
6ddede4863
3 changed files with 13 additions and 8 deletions
|
@ -53,7 +53,8 @@ const props = defineProps({
|
||||||
const componentNodeName = ref<Node['nodeName']>('button')
|
const componentNodeName = ref<Node['nodeName']>('button')
|
||||||
interface ElementBindings {
|
interface ElementBindings {
|
||||||
type?: string;
|
type?: string;
|
||||||
rel?: string,
|
rel?: string;
|
||||||
|
target?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const elementBindings = ref({})
|
const elementBindings = ref({})
|
||||||
|
@ -74,7 +75,10 @@ watchEffect(() => {
|
||||||
// we also set a predefined value for the attribute rel, but make it possible to overwrite this by the user.
|
// we also set a predefined value for the attribute rel, but make it possible to overwrite this by the user.
|
||||||
if ('href' in attrs) {
|
if ('href' in attrs) {
|
||||||
nodeName = 'a'
|
nodeName = 'a'
|
||||||
bindings = {rel: 'noreferrer noopener nofollow'}
|
bindings = {
|
||||||
|
rel: 'noreferrer noopener nofollow',
|
||||||
|
target: '_blank',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentNodeName.value = nodeName
|
componentNodeName.value = nodeName
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="legal-links">
|
<div class="legal-links">
|
||||||
<a :href="imprintUrl" rel="noreferrer noopener nofollow" target="_blank" v-if="imprintUrl">{{ $t('navigation.imprint') }}</a>
|
<BaseButton :href="imprintUrl" v-if="imprintUrl">{{ $t('navigation.imprint') }}</BaseButton>
|
||||||
<span v-if="imprintUrl && privacyPolicyUrl"> | </span>
|
<span v-if="imprintUrl && privacyPolicyUrl"> | </span>
|
||||||
<a :href="privacyPolicyUrl" rel="noreferrer noopener nofollow" target="_blank" v-if="privacyPolicyUrl">{{ $t('navigation.privacy') }}</a>
|
<BaseButton :href="privacyPolicyUrl" v-if="privacyPolicyUrl">{{ $t('navigation.privacy') }}</BaseButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@
|
||||||
import {computed} from 'vue'
|
import {computed} from 'vue'
|
||||||
import {useStore} from 'vuex'
|
import {useStore} from 'vuex'
|
||||||
|
|
||||||
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
const imprintUrl = computed(() => store.state.config.legal.imprintUrl)
|
const imprintUrl = computed(() => store.state.config.legal.imprintUrl)
|
||||||
|
|
|
@ -35,9 +35,7 @@
|
||||||
v-model="backgroundSearchTerm"
|
v-model="backgroundSearchTerm"
|
||||||
/>
|
/>
|
||||||
<p class="unsplash-link">
|
<p class="unsplash-link">
|
||||||
<a href="https://unsplash.com" rel="noreferrer noopener nofollow" target="_blank">
|
<BaseButton href="https://unsplash.com">{{ $t('list.background.poweredByUnsplash') }}</BaseButton>
|
||||||
{{ $t('list.background.poweredByUnsplash') }}
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
<div class="image-search-result">
|
<div class="image-search-result">
|
||||||
<a
|
<a
|
||||||
|
@ -83,12 +81,13 @@ import ListService from '@/services/list'
|
||||||
import {CURRENT_LIST} from '@/store/mutation-types'
|
import {CURRENT_LIST} from '@/store/mutation-types'
|
||||||
import CreateEdit from '@/components/misc/create-edit.vue'
|
import CreateEdit from '@/components/misc/create-edit.vue'
|
||||||
import debounce from 'lodash.debounce'
|
import debounce from 'lodash.debounce'
|
||||||
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
|
|
||||||
const SEARCH_DEBOUNCE = 300
|
const SEARCH_DEBOUNCE = 300
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'list-setting-background',
|
name: 'list-setting-background',
|
||||||
components: {CreateEdit},
|
components: {CreateEdit, BaseButton},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
backgroundService: new BackgroundUnsplashService(),
|
backgroundService: new BackgroundUnsplashService(),
|
||||||
|
|
Loading…
Reference in a new issue