Spaces:
Running
Running
Add 6 files
Browse files- EventList.vue +39 -0
- app.js +4 -0
- components/EventList.vue +20 -0
- index.html +1 -19
- main.js +6 -0
- style.css +27 -19
EventList.vue
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="event-list">
|
| 2 |
+
<h2>Upcoming Events</h2>
|
| 3 |
+
<ul>
|
| 4 |
+
<li v-for="event in events" :key="event.id">
|
| 5 |
+
<h3>{{ event.title }}</h3>
|
| 6 |
+
<h4>{{ event.date }}</h4>
|
| 7 |
+
<p>{{ event.description }}</p>
|
| 8 |
+
<button @click="handleEventClick(event.id)">Book Now!</button>
|
| 9 |
+
</li>
|
| 10 |
+
</ul>
|
| 11 |
+
</div>
|
| 12 |
+
|
| 13 |
+
<script>
|
| 14 |
+
|
| 15 |
+
const axios = require("@/axios");
|
| 16 |
+
|
| 17 |
+
export default {
|
| 18 |
+
components: {
|
| 19 |
+
EventList,
|
| 20 |
+
},
|
| 21 |
+
props: {
|
| 22 |
+
events: Array,
|
| 23 |
+
},
|
| 24 |
+
data() {
|
| 25 |
+
return {}
|
| 26 |
+
},
|
| 27 |
+
methods: {
|
| 28 |
+
handleEventClick(eventId) {
|
| 29 |
+
axios.get(`https://api.EventManagement.com/booking/${eventId}`)
|
| 30 |
+
.then((response) => {
|
| 31 |
+
console.log(response.data);
|
| 32 |
+
})
|
| 33 |
+
.catch((error) => {
|
| 34 |
+
console.log(error);
|
| 35 |
+
});
|
| 36 |
+
},
|
| 37 |
+
},
|
| 38 |
+
};
|
| 39 |
+
</script>
|
app.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { createApp } from "vue";
|
| 2 |
+
import EventList from "./components/EventList.vue";
|
| 3 |
+
|
| 4 |
+
createApp({}).component("event-list", EventList).mount("#app");
|
components/EventList.vue
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const EventList = {
|
| 2 |
+
props: {
|
| 3 |
+
events: Array,
|
| 4 |
+
},
|
| 5 |
+
template: `
|
| 6 |
+
<div class="event-list">
|
| 7 |
+
<h2>Upcoming Events</h2>
|
| 8 |
+
<ul>
|
| 9 |
+
<li v-for="event in events" :key="event.id">
|
| 10 |
+
<h3>{{ event.title }}</h3>
|
| 11 |
+
<h4>{{ event.date }}</h4>
|
| 12 |
+
<p>{{ event.description }}</p>
|
| 13 |
+
<button @click="handleEventClick(event.id)">Book Now!</button>
|
| 14 |
+
</li>
|
| 15 |
+
</ul>
|
| 16 |
+
</div>
|
| 17 |
+
`,
|
| 18 |
+
};
|
| 19 |
+
|
| 20 |
+
export default EventList;
|
index.html
CHANGED
|
@@ -1,19 +1 @@
|
|
| 1 |
-
<
|
| 2 |
-
<html>
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="utf-8" />
|
| 5 |
-
<meta name="viewport" content="width=device-width" />
|
| 6 |
-
<title>My static Space</title>
|
| 7 |
-
<link rel="stylesheet" href="style.css" />
|
| 8 |
-
</head>
|
| 9 |
-
<body>
|
| 10 |
-
<div class="card">
|
| 11 |
-
<h1>Welcome to your static Space!</h1>
|
| 12 |
-
<p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
|
| 13 |
-
<p>
|
| 14 |
-
Also don't forget to check the
|
| 15 |
-
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
| 16 |
-
</p>
|
| 17 |
-
</div>
|
| 18 |
-
</body>
|
| 19 |
-
</html>
|
|
|
|
| 1 |
+
<html><head><link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" /><script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script><script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script><script defer src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.156.1/three.min.js"></script><script type="module" src="main.js"></script><title>Event Management and Booth Booking</title></head><body><main><h1><center>Event Management and Booth Booking</center></h1><div class="container"><div class="event-list"><h2>Upcoming Events</h2><ul></ul></div></div></main></body></html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const app = new Vue({
|
| 2 |
+
el: '#app',
|
| 3 |
+
components: {
|
| 4 |
+
EventList,
|
| 5 |
+
},
|
| 6 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,36 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
|
| 18 |
-
.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
.
|
| 27 |
-
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
* {
|
| 2 |
+
box-sizing: border-box;
|
|
|
|
| 3 |
}
|
| 4 |
|
| 5 |
+
body {
|
| 6 |
+
margin: 0;
|
| 7 |
+
padding: 0;
|
| 8 |
+
font-family: Arial, sans-serif;
|
| 9 |
+
display: flex;
|
| 10 |
+
justify-content: center;
|
| 11 |
+
align-items: center;
|
| 12 |
+
min-height: 100vh;
|
| 13 |
}
|
| 14 |
|
| 15 |
+
.event-list {
|
| 16 |
+
max-width: 500px;
|
| 17 |
+
margin: 20px;
|
| 18 |
+
padding: 20px;
|
| 19 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
| 20 |
+
border-radius: 5px;
|
| 21 |
+
background-color: #fff;
|
| 22 |
}
|
| 23 |
|
| 24 |
+
.event-list ul {
|
| 25 |
+
list-style-type: none;
|
| 26 |
+
margin: 0;
|
| 27 |
+
padding: 0;
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
+
.event-list li {
|
| 31 |
+
padding: 10px;
|
| 32 |
}
|
| 33 |
+
|
| 34 |
+
.event-list h2 {
|
| 35 |
+
margin-bottom: 10px;
|
| 36 |
+
}
|