mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-28 16:42:04 +00:00
26 lines
387 B
Vue
26 lines
387 B
Vue
|
<template>
|
||
|
<div>
|
||
|
<p>{{ text }}</p>
|
||
|
<ComponentWithFetch>
|
||
|
<ComponentWithFetch name="sub-component" />
|
||
|
</ComponentWithFetch>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data () {
|
||
|
return {
|
||
|
text: ''
|
||
|
}
|
||
|
},
|
||
|
fetch () {
|
||
|
this.text = 'page-fetch-called'
|
||
|
|
||
|
if (this.$preview) {
|
||
|
this.text = 'page-fetch-called-in-preview'
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|