Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using cash in vue-script2 #11

Open
vad11 opened this issue Aug 8, 2017 · 4 comments
Open

Using cash in vue-script2 #11

vad11 opened this issue Aug 8, 2017 · 4 comments

Comments

@vad11
Copy link

vad11 commented Aug 8, 2017

I write in html code
<img src="main.js" style=display:none;>
and

mounted() {
  Script2.load('main.js').then(function () {
     console.log( "Loaded !" );
    })
}

I test this in chrome dev tools and not see that script loaded from cash.

@taoeffect
Copy link
Owner

If you mean cache.. I have no idea what you're trying to do here, or why you've assigned a script to an <img> tag. :-\

@vad11
Copy link
Author

vad11 commented Aug 10, 2017

I want load script without running, and load script after this from vue after dom maked and run it. But I want load in vue from cash from previous loading by html.

@taoeffect
Copy link
Owner

Hmm, I have no idea how to do that, sorry.

Why not just put the script's functionality into a function, and then call the function when you need it?

@vad11
Copy link
Author

vad11 commented Aug 11, 2017

If I load script in html, I cant call function from vue on mount component. I resive function not defined. And If I load function vye script2 function called ok. Then I load js by html and load next time by script2 from cash and run my Init function. If you help me run function from script loaded from html in vue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants