Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amend Vue plugin usages with package manager and module loader #1215

Merged
merged 1 commit into from
Feb 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions docs/integrations/vue.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Example:
.. sourcecode:: html

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

Note that this CDN build auto-initializes the Vue plugin.
Expand All @@ -45,6 +44,17 @@ npm

$ npm install raven-js --save

.. code-block:: html

<script src="/node_modules/vue/dist/vue.js"></script>
<script src="/node_modules/raven-js/dist/raven.js"></script>
<script src="/node_modules/raven-js/dist/plugins/vue.js"></script>
<script>
Raven
.config('___PUBLIC_DSN___')
.addPlugin(Raven.Plugins.Vue)
.install();
</script>

Bower
`````
Expand All @@ -53,6 +63,27 @@ Bower

$ bower install raven-js --save

.. code-block:: html

<script src="/bower_components/vue/dist/vue.js"></script>
<script src="/bower_components/raven-js/dist/raven.js"></script>
<script src="/bower_components/raven-js/dist/plugins/vue.js"></script>
<script>
Raven
.config('___PUBLIC_DSN___')
.addPlugin(Raven.Plugins.Vue)
.install();
</script>

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`:

.. code-block:: javascript

Raven.addPlugin(Raven.Plugins.Vue, Vue);

Module loaders
~~~~~~~~~~~~~~

In your main application file, import and configure both Raven.js and the Raven.js Vue plugin as follows:

.. code-block:: js
Expand Down