Developing an app with Vue (2,main.js)

Source: Internet
Author: User

Yesterday with Vue's official website to build a Vue scaffolding, I was the first time with Vue all in the groping stage.

Today, try to see what's inside the scaffold.

First look at Main.js.

3 Modules imported a Vue, an app, and a router.


Vue. Config. Productiontip = false turn off the hints given in production mode

and then what do the following do?
New Vue ({  ' #app ',  router,  ' <App/> ', components  : {app}})

here, I found some explanations for the Vue website.What is a component?

Component (Component) is one of the most powerful features of Vue.js. Components can extend HTML elements to encapsulate reusable code. At a higher level, the component is a custom element, and the compiler for Vue.js adds special functionality to it. In some cases, a component can also be the form of a native HTML element, extended with the IS attribute.

That would probably understand main.js.

A new instance has been created
New Vue ({ ' #app ',
Provides mount element router,
//Routing ' <App/> ',
Template Components : {APP}
Component})

Developing an app with Vue (2,main.js)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.