简体   繁体   中英

Access javascript object in vue.js

How can I access the javascript object which is available when I use browser console in vuejs component. I am using a javascript library. I added the javascript script in index.html which created the javascript object in DOM. But I am not able to access the object directly in vuejs.

  <head>
    <script
    id="fsc-api"
    src="https://d1f8f9xcsvx3ha.cloudfront.net/sbl/0.8.0/fastspring-builder.min.js"
    type="text/javascript"
    data-storefront="fastspringexamples.test.onfastspring.com/popup-fastspringexamples">
    </script>
 </head>

so I can see the object fastspring in browser console window but when I am directly using this object in vuejs component its says fastspring is not defined. However, if I console.log this object from component I can see the object in browser console.

用作window.<nameoftheobject>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM