mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +00:00
30 lines
396 B
Vue
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>
|