taoeffect / vue-script2

Standardized, designer-friendly <script> behavior for your Single Page App
171 stars 15 forks source link

help about js file 404 #34

Closed yanhj93 closed 2 years ago

yanhj93 commented 5 years ago

which I want to do is throw an old html page into this vue project.

<!--example3.html file-->
<div style="color: red;">
    I am a html file container script
    <script2 src="../1.js"></script2>
</div>
<!--1.js file-->
var App = function () {
    console.log('1.js run')
}

App();

project structure image

thanks for your help!

bignamehere commented 2 years ago

Just guessing, but you need the 1.js file accessible to where the application is running. I don't see a 1.js file in your dist directory, so your path within the application should be relative to what is in dist, not src.

yanhj93 commented 2 years ago

thanks for you help, but this issue has really gone out of my mind. I will just let it go. thanks again.