I've created an application that takes an address or city and displays the most Favorited tweet at that location using Vuejs. I've written three methods for each thing that needs to happen.
First, I grab an auth key from a url fragment. Second, I pass the address to google's api to get cordinates. Finally, I use the key and location from the first two methods to make the final Api request to get the content I want.
As it stands I have three buttons that appear on the appropriate step and trigger their method with an @click. Is there a way to trigger a sequence of methods with @click? It seems like I may be able to use $emit to chain them together but I am new to developing on the web and don't fully understand what I've read so far.
Id like to just have one button do all three. My solution as it stands:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title></title>
</head>
<body>
<div id="app">
<button @click="method1">button 1</button>
<button @click="method2">button 2</button>
<button @click="method3">button 3</button>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js">
</script>
<script>
new Vue({
el: "#app",
methods: {
method1: function(){
alert("first thing happened");
},
method2: function(){
alert("second thing happend");
},
method3: function(){
alert("third thing happened")
}
}
});