mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
e934da3c36
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Clark Du <clark.duxin@gmail.com>
36 lines
695 B
Vue
36 lines
695 B
Vue
<template>
|
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
<pre id="data" v-html="JSON.stringify($data)" />
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
async asyncData () {
|
|
await new Promise(resolve => setTimeout(resolve, 100))
|
|
return {
|
|
async: 'data',
|
|
async2: 'data2'
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
foo: 'bar',
|
|
user: {
|
|
name: 'Baz',
|
|
inventory: {
|
|
type: 'green',
|
|
items: ['A']
|
|
}
|
|
}
|
|
}
|
|
},
|
|
async fetch () {
|
|
await new Promise(resolve => setTimeout(resolve, 100))
|
|
this.user.inventory.items.push('B')
|
|
this.user.name = 'Potato'
|
|
this.foo = 'barbar'
|
|
this.async2 = 'data2fetch'
|
|
}
|
|
}
|
|
</script>
|