JefferyHus / v-odometer

Odometer VueJS component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Odometer is not defined nuxt

ouahibAbdou opened this issue · comments

Hi I'm using nuxt and I want to use Odometer this the code
`

<script> import VueOdometer from "v-odometer/src"; export default { components: { "vue-odometer": VueOdometer }, data() { return { counter: 11222 }; } }; </script>`

First you will have to let Nuxt know that https://github.com/HubSpot/odometer/blob/master/odometer.min.js is required to be loaded in order for Odometer object to be intiated.
This an FAQ from nuxt official website to help you out.

I am closing this as there is no response, feel free to re-open if the issue is still persistent.

I'm struggling with this. I followed the FAQ and added to my nuxt.config file, but it's still not working.

head: { script: [ { src: 'https://github.com/HubSpot/odometer/blob/master/odometer.min.js' } ],

This is more likely related to Nuxt loading scripts into your DOM. For now I am working on a new version which will be independent of odometer library.

This is more likely related to Nuxt loading scripts into your DOM. For now I am working on a new version which will be independent of odometer library.

xlsdg/vue-odometer#3 (comment)