Get started with vue-resource CDN
MIT licensed
Vue-resource: Simplifies API requests, fetches data in Vue.js apps.
Tags:- vue
- vuejs
- resource
- mvvm
Stable version
Copied!
How to start using vue-resource CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with vue-resource CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script>
<script src="https://cdn.cdnhub.io/vue-resource/1.5.3/vue-resource.min.js"></script>
</head>
<body>
<div id="app">
<button @click="fetchData">Fetch Data</button>
<p v-if="data">{{ data }}</p>
</div>
<script>
new Vue({
el: '#app',
data: {
data: null
},
methods: {
fetchData() {
Vue.http.get('https://jsonplaceholder.typicode.com/todos/1')
.then(response => {
this.data = response.body.title;
})
.catch(error => {
console.log(error);
});
}
}
});
</script>
</body>
</html>
Copied!
Copied!
All versions
0.1.0
0.1.1
0.1.10
0.1.11
0.1.12
0.1.13
0.1.14
0.1.15
0.1.16
0.1.17
0.1.2
0.1.3
0.1.4
0.1.5
0.1.6
0.1.7
0.1.8
0.1.9
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.7.1
0.7.2
0.7.3
0.7.4
0.8.0
0.9.0
0.9.1
0.9.2
0.9.3
1.0.0
1.0.1
1.0.2
1.0.3
1.1.0
1.1.1
1.1.2
1.2.0
1.2.1
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.3.6
1.4.0
1.5.0
1.5.1
1.5.2
*** 1.5.3