myweather/src/views/EditListView.vue
Lance Edgar 5a584982e4 Basic app functions are working
definitely on the "minimal" side but this *mostly* covers my own usage
of the old mobile.weather.gov app
2024-06-08 13:15:29 -05:00

62 lines
1.2 KiB
Vue

<script setup>
import { mapStores } from 'pinia'
import { useLocationStore } from '../stores/location'
</script>
<script>
export default {
computed: {
...mapStores(useLocationStore),
},
methods: {
deleteLocation(location) {
this.locationStore.removeLocation(location)
},
},
}
</script>
<template>
<main>
<o-button variant="primary"
size="small"
icon-left="arrow-left"
@click="$router.push('/')">
Back
</o-button>
<h5 class="is-size-5">Saved Locations</h5>
<br />
<div v-for="location in locationStore.locations"
:key="location.coordinates"
class="block location">
<div>
<p>{{ location.cityState }}</p>
<p class="is-size-7">{{ location.coordinates }}</p>
</div>
<o-button variant="danger"
size="small"
@click="deleteLocation(location)">
<o-icon icon="trash" />
</o-button>
</div>
</main>
</template>
<style scoped>
div.location {
border: 1px solid black;
border-radius: 5px;
padding: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
</style>