javascriptvue.jsquasar

How can I read the js script in Vue/Quasar


Example Code:

<script type="text/javascript" src="https://widget.freshworks.com/widgets/<widget_id>.js" async defer></script>

I want to add to Quasar Framework and use the js in Vue. Any idea to add? Example I want to add inside this script in Quasar:

<script>
export default {
   
}
</script>


Solution

  • I had the same issue. In my case I added the script to my component via the mounted method.

    let widgetScript = document.createElement('script')
    widgetScript.setAttribute('src', 'https://widget.freshworks.com/widgets/') 
    document.head.appendChild(widgetScript) 
    

    Just look at this answer