X
X
xcuube2020-07-14 18:24:21
Vue.js
xcuube, 2020-07-14 18:24:21

How to move vue to a separate file?

There is an Html file, in the script tag it has the following code:
5f0dcd74e1622002283290.png

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 answer(s)
A
Alexander, 2020-07-14
@UPSA

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

Write how you did it)))
and did you connect vue.js?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question