mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-10 14:00:47 +08:00
Add activity module with milk tea event
This commit is contained in:
31
open-isle-cli/src/views/ActivityListPageView.vue
Normal file
31
open-isle-cli/src/views/ActivityListPageView.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div class="activity-list-page">
|
||||
<h1>活动列表</h1>
|
||||
<ul>
|
||||
<li v-for="a in activities" :key="a.id">{{ a.title }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { API_BASE_URL } from '../main'
|
||||
|
||||
export default {
|
||||
name: 'ActivityListPageView',
|
||||
data() {
|
||||
return { activities: [] }
|
||||
},
|
||||
async mounted() {
|
||||
const res = await fetch(`${API_BASE_URL}/api/activities`)
|
||||
if (res.ok) {
|
||||
this.activities = await res.json()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.activity-list-page {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user