Hello, ladies and gentlemen, I am a beginner with vue and I am creating a list, but I am having difficulty understanding how I will sort the list by clicking on the following title column:
new Vue({
el: "#lista",
data:{
users :[
{nome: "Marcos Santos", email: "[email protected]"},
{nome: "Lennon Bueno", email: "[email protected]"}
]
}
})
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Vue 1</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/vue"></script></head><body><divclass="container">
<div id="lista">
<table class="table table-bordered">
<tr>
<th><a href="#">Nome</a></th>
<th><a href="#">Email</a></th>
</tr>
<tr v-for="item in users">
<td>{{item.nome}}</td>
<td>{{item.email}}</td>
</tr>
</table>
</div> <!-- #lista -->
</div> <!-- .container -->
<script>
</script>
</body>
</html>
I would like when you click on the name of the order, by email, and by email, where do I start?