shershen08 / vue-ya-metrica

Yandex.Metrica component for Vue.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to correctly install?

zhanswift opened this issue · comments

How to correctly install?

I put vue-ya-metrica.js to js folder and add it to index.html like this

<script src="js/vue-ya-metrica.js"></script>

and in index.html:

<body>
<div id="app">
<vue-ya-metrica counter="ХХХХХ" enable-hash="true" enable-webvisor="true"></vue-ya-metrica>
<router-view>
</router-view>
</div>
<script src="/dist/build.js"></script>
</body>

But I got error:

Uncaught ReferenceError: Vue is not defined at vue-ya-metrica.js:1

Where I need put vue-ya-metrica.js?

You are right, the plugin code was not fully aligned for working via webpack. I've created a https://github.com/shershen08/vue-ya-metrica/tree/dev branch and published a npm module. Please give a it a try

please check the updated README and version 1.0.2 - now should work sufficiently