Vue
by ujjumaki
HTML
<div id="app">
<h2>Programming Classes Time</h2>
<div v-for="todo in todos">
<p>{{todo.time}}</p>
<!-- Is there a way to display 7:00 PM only once and under 7:00 PM display Javascript, JQuery and PHP -->
<!-- display 8:00 PM only once and under it there should be CSS, HTML and MySQL -->
<p>{{todo.text}}</p>
<br/>
</div>
</div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
li {
margin: 8px 0;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
del {
color: rgba(0, 0, 0, 0.3);
}
Vue
new Vue({
el: "#app",
data: {
todos: [
{ text: "Javascript", time: "7:00 PM" },
{ text: "JQuery", time: "7:00 PM" },
{ text: "PHP", time: "7:00 PM" },
{ text: "CSS", time: "8:00 PM" },
{ text: "HTML", time: "8:00 PM" },
{ text: "MySQL", time: "8:00 PM" }
]
},
methods: {
toggle: function(todo){
todo.done = !todo.done
}
}
})