S
S
Stanislav2018-02-10 15:50:35
Vue.js
Stanislav, 2018-02-10 15:50:35

How to use a file built by vue-build?

I'm trying to deal with vue.js, I can't find an answer to the question in the documentation.
vue-build creates a file dist/index.js
How can I use it in the browser? Connecting to the html page through gives nothing. I don’t need to launch the built-in server , because I have my own server, on Perl, and vue needs to be connected to the framework template. <script src="...">vue-build dev

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Polos, 2018-02-10
@dimovich85

Simply connect the index.js file to html and that's it, the main thing is that there is some element in html that is a mount point, in short, for example, a div with id "app", the selector that is passed to the el field in the vue instance. This is the first condition, and the second, apparently nothing works, because the path in the script src starts with a slash, that is, from the root of the disk, if it is on the local, connect it, that is, put a dot before the slash, that is, from the current directory to look for the file. <script src="./dist/index.js"></script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question