how to use axios in vue

JavaScript
//Install Axios from terminal
npm install axios
//Import Axios in your HelloWorld.vue
import axios from 'axios'
//Add a method to implement Axios
test () {
      axios.post('URL')
      .then(function (response) {
        alert (response.data);
      })
      .catch(function (error) {
        alert(error);
      });
    } <a :href="post.url" target="_blank"><img :src="post.image_url"></a>
Source

Also in JavaScript: