K
K
kr_ilya2019-11-16 16:44:51
JavaScript
kr_ilya, 2019-11-16 16:44:51

ReferenceError after navigating from vue inner page (nuxt)?

Used by nuxt
in the component

export default {
  head: {
    script: [
      { src: '/js/chart.min.js'},
    ]
  },
...
mounted(){
        this.chart = new Chart(ctx, { //ОШИБКА НА ЭТОЙ СТРОКЕ 
          type: 'line',
          data: this.chartData,
          options: this.chartOption
        })
}

When the page loads normally, everything is fine.
But if I go from the internal page (along the route), I get this in the browser console
ReferenceError: Chart is not defined
. What could be the problem? ssr? or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kr_ilya, 2019-11-17
@kr_ilya

https://gist.github.com/rvanzon/096132b7b46be43659...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question