mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 18:13:54 +00:00
22 lines
316 B
Vue
22 lines
316 B
Vue
|
<template>
|
||
|
<button @click="$fetch">
|
||
|
fetch {{ foo }}
|
||
|
</button>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
async fetch () {
|
||
|
await new Promise(resolve => setTimeout(resolve, 100))
|
||
|
|
||
|
this.foo = this.$fetch ? 'has fetch' : 'hasn\'t fetch'
|
||
|
},
|
||
|
|
||
|
data () {
|
||
|
return {
|
||
|
foo: null
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|