Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit b675df9

Browse files
committed
Merge branch 'release/0.6.1'
2 parents ed85a38 + d624b71 commit b675df9

File tree

9 files changed

+207
-199
lines changed

9 files changed

+207
-199
lines changed

README.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The plugin provides services for making web requests and handle responses using
1010

1111
Add `vue` and `vue-resource` to your `package.json`, then `npm install`, then add these lines in your code:
1212

13-
```javascript
13+
```js
1414
var Vue = require('vue');
1515

1616
Vue.use(require('vue-resource'));
@@ -20,14 +20,14 @@ Vue.use(require('vue-resource'));
2020

2121
Set default values using the global configuration.
2222

23-
```javascript
23+
```js
2424
Vue.http.options.root = '/root';
2525
Vue.http.headers.common['Authorization'] = 'Basic YXBpOnBhc3N3b3Jk';
2626
```
2727

2828
Set default values inside your Vue component options.
2929

30-
```javascript
30+
```js
3131
new Vue({
3232

3333
http: {
@@ -70,7 +70,7 @@ The http service can be used globally `Vue.http` or in a Vue instance `this.$htt
7070

7171
### Example
7272

73-
```javascript
73+
```js
7474
new Vue({
7575

7676
ready: function() {
@@ -110,7 +110,7 @@ The resource service can be used globally `Vue.resource` or in a Vue instance `t
110110

111111
### Default Actions
112112

113-
```javascript
113+
```js
114114
get: {method: 'GET'},
115115
save: {method: 'POST'},
116116
query: {method: 'GET'},
@@ -120,7 +120,7 @@ delete: {method: 'DELETE'}
120120
```
121121

122122
### Example
123-
```javascript
123+
```js
124124
new Vue({
125125

126126
ready: function() {
@@ -155,7 +155,7 @@ new Vue({
155155

156156
Interceptors can be defined globally and are used for pre- and postprocessing of a request.
157157

158-
```javascript
158+
```js
159159
Vue.http.interceptors.push({
160160

161161
request: function (request) {
@@ -169,26 +169,20 @@ Vue.http.interceptors.push({
169169
});
170170
```
171171

172-
#### Interceptor Factory
172+
A factory function can also be used.
173173

174-
If Promises are needed inside of a Interceptor, a factory function can be used.
175-
176-
```javascript
177-
Vue.http.interceptors.push(function (Promise) {
174+
```js
175+
Vue.http.interceptors.push(function () {
178176
return {
179177

180-
request: function (request) {
181-
if (reject) {
182-
return Promise.reject();
183-
}
184-
},
178+
request: function (request) {
179+
return request;
180+
},
185181

186-
response: function (response) {
187-
if (reject) {
188-
return Promise.reject();
189-
}
190-
}
182+
response: function (response) {
183+
return response;
184+
}
191185

192-
};
186+
};
193187
});
194188
```

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue-resource",
33
"main": "dist/vue-resource.js",
44
"description": "A web request service for Vue.js",
5-
"version": "0.6.0",
5+
"version": "0.6.1",
66
"homepage": "https://github.com/vuejs/vue-resource",
77
"license": "MIT",
88
"ignore": [

0 commit comments

Comments
 (0)