👻 A Vue 2.0 component that fetches data from a http request.
Sometimes we just want to requrest an api and display data in the view. Why not write directly in the template.🤔
- Supports fetch and other HTTP clients(axios, vue-resource, etc.)
- Supports polling
- Simplify your code
yarn add vuetch
# npm i vuetch -S
import Vuetch from 'vuetch'
import Vue from 'vue'
Vue.use(Vuetch)
<vuetch url="https://api.github.com/users/QingWei-Li">
<template scope="props">
<pre>{{ props.data }}</pre>
<pre>{{ props.error }}</pre>
<div>{{ props.loading }}</div>
</template>
</vuetch>
- url
- options
- http
- loop
- delay
- immediate
- defaultData
- manual
- onerror
- onsuccess
- oncomplete
- data
- error
- $load
- $poll
- Documentation
- Demo
- Unit test
- Publish
MIT