Vuejs and Axios injecting in the html site

You know the better way using CLI and Component…

  


  <script src="https://cdn.jsdelivr.net/npm/vue"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>




<div id="app">
  {{ info }}
</div>





<script>
   
new Vue({

  el: '#app',
  data () {
    return {
      info: null
    }
  },
  mounted () {
    axios
      .get('https://api.coindesk.com/v1/bpi/currentprice.json')
      .then(response => (this.info = response))
  }
})
 </script>



  

B logbook : PHP | Javascript | Laravel | CodeIgniter | Vue.js | WordPress