Nuxt/docs/components/atoms/ReadMore.vue

30 lines
542 B
Vue
Raw Normal View History

<template>
<Alert icon="👉">
Read more in <Link :to="link" v-text="computedTitle" />.
</Alert>
</template>
<script>
import { defineComponent } from '@nuxtjs/composition-api'
2022-04-09 09:25:13 +00:00
import createTitle from '~/utils/createTitle'
export default defineComponent({
props: {
link: {
type: String,
required: true
},
title: {
type: String,
required: false
}
},
computed: {
computedTitle () {
// Guess title from link!
2022-04-09 09:25:13 +00:00
return createTitle(this.title, this.link)
}
}
})
</script>