How to Add WheelWidget Script to Nuxt Website

If you're using Nuxt to build your website and want to add the WheelWidget script to it, follow these simple steps:

  1. Open your Nuxt project and navigate to the page where you want to add the WheelWidget script.
  2. In the component where you want to add the WheelWidget, add the following code to the template:
<script    src="https://files.wheelwidget.com/wheel-widget.umd.js"    async defer></script><wheel-widget id="YOUR_ID"></wheel-widget>

Make sure to replace "YOUR_ID" with your actual widget ID, which you can find in the admin panel of your WheelWidget account.

  1. In the same component, add the following code to the mounted() method:
mounted() {  const script = document.createElement('script');  script.src = 'http://files.wheelwidget.com/wheel.js';  script.setAttribute('data-id', 'YOUR_ID');  document.body.appendChild(script);},

Make sure to replace "YOUR_ID" with your actual widget ID, which you can find in the admin panel of your WheelWidget account.

  1. Save your changes and reload your Nuxt application.

That's it! The WheelWidget script should now be installed on your Nuxt website. If you encounter any issues or have any questions, feel free to contact us.

We hope this instruction was helpful in adding the WheelWidget script to your Nuxt website. If you have any feedback or suggestions, please let us know.

Our support & Q team email