Test asyncData method.

This commit is contained in:
2020-12-17 17:07:22 +01:00
parent 6941293c14
commit 23595f0e58
3 changed files with 504 additions and 3 deletions

View File

@@ -1,13 +1,13 @@
<template>
<section>
<h1>Ghibli movies</h1>
{{ films }}
<h1>Ghibli films</h1>
<div class="films">{{ films }}</div>
</section>
</template>
<script>
export default {
name: "Movies",
name: "Films",
async asyncData({ $axios }) {
const films = await $axios.$get("/api/films");
return { films };