[Vuejs]-I want to put multiple versions of jquery in CDN in nuxt

0👍

Is it a solution for the time being from the request for additional / correction to the question? Came to.

  1. Make a function that describes the process you want to initialize immediately after loading jquery in methods
  2. Register the event with the function beforemonted
  3. Make it possible to fire that event in the onload of the head script

After reading jQuety by onload to the script of head method, methods fire

head() {
    return {
      bodyAttrs: {
        id: 'photographer'
      },
      script: [
        {
          src:
            'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js',
          async: true,
          onload: this.onJqueryLoad()
        }
      ]
    }
}

Enter the methods you want to fire after reading

methods: {
    onJqueryLoad() {
      this.$nextTick(() => {
        if (process.browser) {
          JqueryEasing()
         MagnificPopup()
         useragent()
        }
      })
    }
}

mounted method removed
Others as they are
So it worked.

Leave a comment