Skip to content

Commit b532909

Browse files
myst729kamilogorek
authored andcommitted
docs: Vue plugin usages with package manager and module loader (#1215)
1 parent dd10b74 commit b532909

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

docs/integrations/vue.rst

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Example:
2727
.. sourcecode:: html
2828

2929
<script src="https://cdn.jsdelivr.net/vue/2.0.0-rc/vue.min.js"></script>
30-
<script src="https://cdn.ravenjs.com/###RAVEN_VERSION###/vue/raven.min.js"
31-
crossorigin="anonymous"></script>
30+
<script src="https://cdn.ravenjs.com/###RAVEN_VERSION###/vue/raven.min.js" crossorigin="anonymous"></script>
3231
<script>Raven.config('___PUBLIC_DSN___').install();</script>
3332

3433
Note that this CDN build auto-initializes the Vue plugin.
@@ -45,6 +44,17 @@ npm
4544
4645
$ npm install raven-js --save
4746
47+
.. code-block:: html
48+
49+
<script src="/node_modules/vue/dist/vue.js"></script>
50+
<script src="/node_modules/raven-js/dist/raven.js"></script>
51+
<script src="/node_modules/raven-js/dist/plugins/vue.js"></script>
52+
<script>
53+
Raven
54+
.config('___PUBLIC_DSN___')
55+
.addPlugin(Raven.Plugins.Vue)
56+
.install();
57+
</script>
4858

4959
Bower
5060
`````
@@ -53,6 +63,27 @@ Bower
5363
5464
$ bower install raven-js --save
5565
66+
.. code-block:: html
67+
68+
<script src="/bower_components/vue/dist/vue.js"></script>
69+
<script src="/bower_components/raven-js/dist/raven.js"></script>
70+
<script src="/bower_components/raven-js/dist/plugins/vue.js"></script>
71+
<script>
72+
Raven
73+
.config('___PUBLIC_DSN___')
74+
.addPlugin(Raven.Plugins.Vue)
75+
.install();
76+
</script>
77+
78+
These examples assume that Vue is exported globally as `window.Vue`. You can alternatively pass a reference to the `Vue` object directly as the second argument to `addPlugin`:
79+
80+
.. code-block:: javascript
81+
82+
Raven.addPlugin(Raven.Plugins.Vue, Vue);
83+
84+
Module loaders
85+
~~~~~~~~~~~~~~
86+
5687
In your main application file, import and configure both Raven.js and the Raven.js Vue plugin as follows:
5788

5889
.. code-block:: js

0 commit comments

Comments
 (0)