2020-02-04 18:36:22 +00:00
|
|
|
<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']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-11-14 17:10:53 +00:00
|
|
|
},
|
|
|
|
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'
|
2020-02-04 18:36:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|