Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<template> | ||
<v-app> | ||
<v-content> | ||
<v-container> | ||
<v-alert type="success"> | ||
<p> | ||
<strong>Cities</strong> demonstrates how props can be consumed by the setup method. It can be passed as simply as <code>setup(props)</code> but best practices dictate that object destructuring be used instead: <code>setup({ city })</code>. | ||
</p> | ||
</v-alert> | ||
|
||
<v-card class="mx-auto" max-width="400" tile> | ||
<v-list-item three-line v-for="city in data.cities" :key="city.id"> | ||
<cities-item :city="city" /> | ||
</v-list-item> | ||
</v-card> | ||
</v-container> | ||
</v-content> | ||
</v-app> | ||
</template> | ||
|
||
<script> | ||
import { reactive } from "@vue/composition-api"; | ||
import CitiesItem from "./CitiesItem"; | ||
export default { | ||
components: { | ||
CitiesItem | ||
}, | ||
setup() { | ||
const data = reactive({ | ||
cities: [ | ||
{ | ||
id: 1, | ||
name: "Barcelona", | ||
country: "Spain", | ||
visited: true | ||
}, | ||
{ | ||
id: 2, | ||
name: "Berlin", | ||
country: "Germany", | ||
visited: true | ||
}, | ||
{ | ||
id: 3, | ||
name: "Addis Ababa", | ||
country: "Ethiopia", | ||
visited: false | ||
} | ||
] | ||
}); | ||
return { | ||
data | ||
}; | ||
} | ||
}; | ||
</script> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters