summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-04-21 14:19:05 +0000
committerPhil Hughes <me@iamphill.com>2017-04-21 14:19:05 +0000
commitc76812c79ffe3ca35b00faeaaf7fa1c362d1d27d (patch)
treec224c53d60bf851e5ed6cdb67c6e42562814d14b
parentf97d818cd7ed707cf0d1d6789998b11b5430fbc7 (diff)
parent1e92f8b6ce70fff1a375e6797cef3bf0ae9d27c3 (diff)
downloadgitlab-ce-c76812c79ffe3ca35b00faeaaf7fa1c362d1d27d.tar.gz
Merge branch 'vue-doc-2' into 'master'
Add help regarding vue resource and where to include it See merge request !10819
-rw-r--r--doc/development/fe_guide/vue.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/development/fe_guide/vue.md b/doc/development/fe_guide/vue.md
index 45c8300d9de..73d2ffc1bdc 100644
--- a/doc/development/fe_guide/vue.md
+++ b/doc/development/fe_guide/vue.md
@@ -103,6 +103,21 @@ The Service is a class used only to communicate with the server.
It does not store or manipulate any data. It is not aware of the store or the components.
We use [vue-resource][vue-resource-repo] to communicate with the server.
+Vue Resource should only be imported in the service file.
+
+ ```javascript
+ import Vue from 'vue';
+ import VueResource from 'vue-resource';
+
+ Vue.use(VueResource);
+ ```
+
+### CSRF token
+We use a Vue Resource interceptor to manage the CSRF token.
+`app/assets/javascripts/vue_shared/vue_resource_interceptor.js` holds all our common interceptors.
+Note: You don't need to load `app/assets/javascripts/vue_shared/vue_resource_interceptor.js`
+since it's already being loaded by `common_vue.js`.
+
### End Result
The following example shows an application:
@@ -288,7 +303,8 @@ new Vue({
```
-The [issue boards service][issue-boards-service] is a good example of this pattern.
+The [issue boards service][issue-boards-service]
+is a good example of this pattern.
## Style guide