Answer the question
In order to leave comments, you need to log in
How to move vue to a separate file?
There is an Html file, in the script tag it has the following code:
How can I put it in a separate .js file?
I tried to transfer it to a file like script.js and then include it in html through it,
but nothing happened
. Please tell me.
<script src="./js/script.js"></script>
Answer the question
In order to leave comments, you need to log in
1) Read https://cli.vuejs.org/ru/config/
2) After the build command, you get a ready-made set of scripts.
3) Read about DOM objects. In your example, el: '#app'
it says that you need to run the application <div id=app></div>
in your html file
Tried to transfer to a file like script.js and then include it in html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question