You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.4 KiB
56 lines
1.4 KiB
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<title>My awesome team</title>
|
|
|
|
<link rel="stylesheet" href="/css/style.css" />
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">
|
|
|
|
<navbar></navbar>
|
|
<div class="team">
|
|
<team-add @add-team="addTeam"></team-add>
|
|
</div>
|
|
<teamcard v-for="team in allTeam"
|
|
:id="team.id"
|
|
:name="team.name"
|
|
:description="team.description">
|
|
</teamcard>
|
|
</div>
|
|
|
|
<script src="./src/misc/constant.js"></script>
|
|
<script src="./src/error/required_field_error.js"></script>
|
|
|
|
|
|
<script type="module">
|
|
import { createApp } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js';
|
|
|
|
import Navbar from '/src/view/navbar.js';
|
|
import TeamAdd from '/src/view/team_add.js';
|
|
import Teamcard from '/src/view/teamcard.js';
|
|
|
|
const app = createApp({
|
|
data() {
|
|
return {
|
|
allTeam: []
|
|
}
|
|
},
|
|
methods:{
|
|
addTeam: function(team){
|
|
console.log('index.addTeam',team);
|
|
this.allTeam.push(team);
|
|
}
|
|
}
|
|
})
|
|
app.component('Navbar', Navbar)
|
|
.component('TeamAdd', TeamAdd)
|
|
.component('Teamcard',Teamcard);
|
|
app.mount('#app');
|
|
</script>
|
|
</body>
|
|
|
|
</html> |