Nuxt/test/fixtures/full-static-with-preview/components/ComponentWithFetch.vue
2022-06-24 01:08:54 +02:00

30 lines
396 B
Vue

<template>
<div>
<p>{{ text }}</p>
<slot />
</div>
</template>
<script>
export default {
props: {
name: {
type: String,
default: 'component'
}
},
data () {
return {
text: ''
}
},
fetch () {
this.text = `${this.name}-fetch-called`
if (this.$preview) {
this.text = `${this.name}-fetch-called-in-preview`
}
}
}
</script>