Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue fetch api

async created() {
  // GET request using fetch with async/await
  const response = await fetch("https://api.npms.io/v2/search?q=vue");
  const data = await response.json();
  this.totalVuePackages = data.total;
}
Source by jasonwatmore.com #
 
PREVIOUS NEXT
Tagged: #vue #fetch #api
ADD COMMENT
Topic
Name
3+4 =