I'm wanting take information from an api for example imdbID and just add ".html" afterwards so I can then make it a variable I can put inside the href of a button. But I'm stuck on how to do this, thank you in advance.
Here is the js:
new Vue({
el: '#app',
data: {
movies: [],
search: '',
},
created() {
var vm = this
axios.get('https://www.omdbapi.com/?s=Harry+Potter&apikey=a9018efb')
.then(function(response) {
vm.movies = response.data.Search
})
},
computed: {
getMovies() {
return this.movies.filter(movie => {
return movie.Title.toLowerCase().includes(this.search.toLowerCase());
})
}
}
})
and here is the important bit of HTML:
<div class="card-body">
<h5 class="card-title">{{ movie.Title }}</h5>
<p class="card-text">{{ movie.Year }}</p>
<p class="card-text"></p>
<a href="" class="btn btn-primary">View Movie</a> //This is where I'm wanting the variable to go
</div>