I
I
iAlex1952018-05-04 16:02:07
Vue.js
iAlex195, 2018-05-04 16:02:07

How to add slug to URL?

const app = new Vue({
el: '#app',
data: {
posts: [],
}
axios.get(' http://asdasd/post/{slug} ') // What is the correct way to add a slug to a URL?
.then(response => {
console.log(response);
this.posts = response.data;
})
.catch(function (error) {
console.log(error);
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2018-05-04
@alvvi

axios.get(`http://asdasd/post/${slug}`)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question