Tag:vue.js
Article From:https://segmentfault.com/q/1010000012144984
Question:

I just learned VUE Xiao Bai, nodejs webpack understands, but it means VUE can’t understand many places. Most important of all:

  1. In the official Hello World example, what is new Vue pointing to App.vue in main.js? How does app.vue file correspond to index.html? Is the index.html written inside, Vue doomedSingle page, HTML can only be called index.html?
  2. What if I wrote a Login.html, a MainFram.html, and N multiple modules.html?

Ask for confusion!!!

Answer 0:

This has nothing to do with Vue. You need to configure multiple entries in webpack.

Answer 1:

This involvesnodeThe loading mechanism of the module,
nodeThere is a way to find a file by yourself, and it will start frompackage.jsonLookup in the configuration filemainConfiguration file, if there is, execution;
Otherwise look up the current pathindex.jsindex.jsonandindex.nodeDocument, if there is, execution;
Otherwise the execution failed and returnedfalse
main.jsThe default route of the file is directedindex.htmlfile

Answer 2:

app.vueThe correspondence with index.html is configured in the config.js file. The official example uses a single page vue.js scaffolding, you can modify the webpack configuration, configure multiple entries, build a multi page scaffolding, and have a modified GitHub on the GitHub.After cloned, you can use it directly. You can try it.

Answer 3:

vueThere are many page development configurations that need online search. See also GitHub.

Answer 4:

@What if Xiaofeng wants main.js to point to other HTML?

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *