VUEJS+ES6 Development mobile App real-combat project notes

Source: Internet
Author: User

I. What is the MVVM framework

mv* includes MVC, MVP, MVVM

The MVVM framework is composed of model, View, ViewModel.

Model refers to the data, which corresponds to the JavaScript object at the front end.

View refers to views, which correspond to the DOM in the front

ViewModel observes the changes of model and view to do the update, and realizes the bidirectional binding of the data.

The front-end MVVM framework mainly includes: AngularJS, Reactjs, Vuejs

Second, the core idea of Vuejs (data-driven, modular)

Data-driven: data bidirectional binding

Component: Any part of the page can be used as a component, the page is just a container of components, one component corresponding to a Vue file, for example: A page is divided into menus, content, the bottom, you can use the menu as a component.

Third, VUE-CLI

Help to write good Vuejs code tools to help us do the directory structure, local debugging, code deployment, unloading, unit testing and other work

Installation:

Global installation: NPM install-g VUE-CLI

New project (use Webpack template here): Vue init webpack <project name>

Then:

CD <project name> Enter the project

NPM Install dependency code base

NPM Run Dev Start service

Iv. Basic usage of Vue-router (2.x version)

Document: http://router.vuejs.org/zh-cn/The most detailed usage also requires more reading of the document

Installation:

Adding Vue-router values to dependencies on Package.json files

Executes the NPM install command, which installs all modules according to the NPM module listed in Package.json

Use:

For example, the page Common tab switch, by clicking, in a region to switch the corresponding components

Toggle button: Router-link component as a link to a single-page routing component, it renders as a link, the To property specifies the link address

Toggle Zone: Router-view component, route matching component rendered in this area

Import the required components

VUEJS+ES6 Development mobile App real-combat project notes

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.