mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-12 09:03:53 +00:00
27 lines
422 B
Vue
27 lines
422 B
Vue
|
<template>
|
||
|
<div>
|
||
|
<button @click="$fetch">
|
||
|
fetch {{ foo }}
|
||
|
</button>
|
||
|
<NuxtChild />
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
fetchKey (getCounter) {
|
||
|
return 'ie' + getCounter('ie')
|
||
|
},
|
||
|
data () {
|
||
|
return {
|
||
|
foo: null
|
||
|
}
|
||
|
},
|
||
|
async fetch () {
|
||
|
await new Promise(resolve => setTimeout(resolve, 100))
|
||
|
|
||
|
this.foo = this.$fetch ? 'has fetch' : 'hasn\'t fetch'
|
||
|
}
|
||
|
}
|
||
|
</script>
|