-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
ef1a0c1
commit c983869
Showing
4 changed files
with
145 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup> | ||
import { ref, onMounted } from 'vue'; | ||
const mapData = ref([]); | ||
onMounted(async () => { | ||
try { | ||
const { default: axios } = await import('axios'); | ||
const response = await axios.get('http://localhost:8000/get_map_data'); | ||
mapData.value = response.data; | ||
} catch (error) { | ||
console.error('Error fetching map data:', error); | ||
} | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="map"> | ||
<div v-for="(row, rowIndex) in mapData" :key="rowIndex" class="map-row"> | ||
<div | ||
v-for="(cell, colIndex) in row" | ||
:key="colIndex" | ||
class="map-cell" | ||
:class="{ 'has-village': cell.hasVillage }" | ||
> | ||
<img v-if="cell.hasVillage" src="village_image_path" alt="Village" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
/* Add your scoped styles */ | ||
</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