Position: Home page » Pool » Vue belongs to MVP miner

Vue belongs to MVP miner

Publish: 2021-04-28 23:50:04
1. First of all, what is the MVx framework pattern? MVx framework pattern: MVC + MVP + mvvm1. MVC: model + view + controller. It is mainly based on the purpose of layering to separate the responsibilities of each other. View is connected with model through controller. Controller is the coordinator of view and model. View and model are not directly connected. The basic connection is one-way. The user operates the template model through the controller to change the view. 2. MVP: it is evolved from MVC mode, and is responsible for logic processing through controller / presenter + data provided by model + display by view. In MVP, the presenter completely separates the view from the model, and the main program logic is implemented in the presenter. Moreover, there is no direct relationship between the presenter and the view. It interacts through the defined interface, so that the presenter can be kept unchanged when changing the view. The framework of MVP pattern: Riot, JS. 3. MVVM: MVVM changes the controller in MVC and the presenter in MVP to ViewModel. Model+View+ViewModel The changes of view will be automatically updated to ViewModel, and the changes of ViewModel will be automatically synchronized to view. This kind of automatic synchronization is because the properties in ViewModel implement the observer, and the corresponding operation can be triggered when the properties change. The framework of MVVM pattern includes angularjs + vue.js and knockout + ember.js, the latter two are less well-known and early rising. What is vue.js? Seeing the above introction of framework pattern, we can know that it belongs to MVVM pattern. What are its characteristics? In fact, vue.js is not a framework, because it only focuses on the view layer. It is a library for building a data-driven web interface. Vue.js provides efficient data binding and flexible component system through simple API. The features of vue.js are as follows: 1. Lightweight framework 2. Bidirectional data binding 3. Instructions 4. What is the difference between plug-in vue.js and other frameworks? 1. Different from angularjs, they both support instructions: built-in instructions and custom instructions. Both support filters: built in filters and custom filters. Both support bidirectional data binding. They don't support low-end browsers. Differences: 1. Angularjs has a high learning cost. For example, the dependency injection feature is added, while the API provided by vue.js is relatively simple and intuitive. 2. In terms of performance, angularjs relies on dirty data checking, so the more watchers, the slower. Vue. JS uses dependency tracking based observations and asynchronous queue updates. All data is triggered independently. For large applications, the optimization difference is obvious. 2. Differences and similarities between react and react: react adopts special JSX syntax, vue.js also advocates writing. Vue special file format in component development, and has some conventions on file content, both of which need to be used after compilation. The central idea is the same: everything is a component, and component instances can be nested. All of them provide reasonable hook functions to allow developers to customize their requirements. No column count, AJAX, route and other functions are built into the core package, but are loaded in the form of plug-ins. Mixins are supported in component development. Difference: react relies on virtualdom, while vue.js uses DOM template. The virtual DOM used in react will check the rendered results. Vue.js provides instructions, filters, etc. in the template, which is very convenient and fast to operate dom. How to use vue.js? 1. Install (1) script if the project loads the CDN file directly through script, the code example is as follows: (2) NPM if the project gives NPM management dependency, you can use NPM to install Vue and execute the following command: $npmivue -- save dev (3) bower if the project is based on bower management dependency, you can use bower to install Vue and execute the following command: $bowerivue -- save dev
2. Vue.js is a JavaScript MVVM library, which is a progressive framework to build user interface. It is based on the idea of data-driven and component-based, and adopts the design of bottom-up incremental development. Compared with angular.js, vue.js provides a more concise and easy to understand API, which enables us to quickly start and use vue.js; At the same time, compared with the relatively complex architecture of react + Rex, vue.js is lighter and easier to use. It is the preferred front-end framework for start-ups. Vue's core library only focuses on view layer, which is not only easy to use, but also easy to integrate with third-party library or existing projects
today, let's learn about Vue, a progressive JavaScript framework

in recent years, in the field of front-end development, the old browser is graally eliminated, the demand of mobile development is increasing year by year, the front-end interaction is more and more, and the function is more and more complex. Architecture migrates from traditional background MVC to rest API + front-end MV *
MV * is equivalent to MVC, that is,
model represents the core of the application (such as database record list)
the view shows that the front-end learning needs continuous learning. One stop a day is equivalent to learning in vain. The learning effect is very poor. If you want someone to study together, you can come to this button skirt, first 132, middle 667, and finally 127. They are all students with zero foundation. We encourage each other and work together. It's not recommended to just learn to play!!! Data (database records)
the controller processes input (writes to database records)
MVP
model represents the core of an application (such as a list of database records)
view displays data (database records)
the presenter is responsible for the logical processing of business< The differences between view and MVC are as follows:
1. View and model are completely isolated
2. The presenter has nothing to do with the specific implementation technology of view
3. Simulation test of view can be carried out<
MVVM (Vue is a MVVM framework)
model represents the core of the application (such as database record list)
view displays data (database records)
the ViewModel (observer) is responsible for synchronizing the data of the model to the view for display, and also for synchronizing the changes of the view back to the model
advantages: high cohesion and low coupling (reusability and portability)
Vue is a data-driven and component-based front-end development framework. Compared with angular and react, vue.js is lighter. After gzip, its size is only 26k (angular 56K, react 44K). At the same time, it is easier to use. The learning curve is smooth and absorbs the advantages of the two. It uses the instruction of angular and the component-based of react for reference.
3. First of all, what is the MVx framework pattern< MVC: model + view + controller, mainly based on the purpose of layering, to separate the responsibilities of each other
View connects with model through controller. Controller is the coordinator of view and model. View and model are not directly connected, and the basic connection is one-way
the user operates the template model through the controller to change the view
2. MVP: it is evolved from MVC mode, and is responsible for logic processing through controller / presenter + data provided by model + view for display
in MVP, the presenter completely separates the view from the model, and the main program logic is implemented in the presenter
in addition, the presenter and view are not directly related, but interact through the defined interface, so that the presenter can be kept unchanged when changing the view
framework of MVP pattern: Riot, JS
3. MVVM: MVVM changes the controller in MVC and the presenter in MVP to ViewModel. Model+View+ViewModel
changes in view will be automatically updated to ViewModel, and changes in ViewModel will be automatically synchronized to view
this automatic synchronization is e to the fact that the properties in ViewModel implement observer, which can trigger the corresponding operation when the properties change
the framework of MVVM mode includes angularjs + vue.js and knockout + ember.js, the latter two are less well-known and early rising
what is vue.js
after seeing the above introction of framework pattern, we can know that it belongs to MVVM pattern. What are its characteristics
in fact, vue.js is not a framework, because it only focuses on view layers and is a library for building data-driven web interfaces
vue.js provides efficient data binding and flexible component system through simple API< The features of vue.js are as follows:
1. Lightweight framework
2. Bidirectional data binding
3. Instructions
4. Plug in
what is the difference between vue.js and other frameworks< Different from angularjs,
the same point:
both support instructions: built-in instructions and custom instructions
both support filters: built in filters and custom filters
both support bidirectional data binding
does not support low-end browsers
differences:
1. Angularjs has a high learning cost, such as adding the dependency injection feature, while the API provided by vue.js is relatively simple and intuitive
2. In terms of performance, angularjs relies on dirty data checking, so the more watchers, the slower
vue.js uses dependency tracking based observations and asynchronous queue updates. All data is triggered independently
for large applications, the optimization difference is obvious
2. Differences from react:
similarities:
react adopts special JSX syntax, vue.js also advocates writing. Vue special file format in component development, and has some conventions on file content, both of which need to be used after compilation
the central idea is the same: everything is a component, and component instances can be nested
all of them provide reasonable hook functions for developers to customize their requirements
no column count, AJAX, route and other functions are built into the core package, but are loaded in the form of plug-ins
mixins are supported in component development
differences:
react relies on virtual DOM, while vue.js uses DOM template. The virtual DOM used in react will do dirty check on the rendered results
vue.js provides instructions, filters, etc. in the template, which is very convenient and fast to operate dom
how to use vue.js
1. Install
(1) script
if the project loads the CDN file directly through script, the code example is as follows:
& lt; script src=" http://www..com/vue.min.js"& gt;& lt;/ script>
(2) NPM
if the project is given NPM management dependency, then NPM can be used to install Vue, and execute the following command:
$NPM I Vue -- save dev
(3) bower
if the project is based on Bower management dependency, bower can be used to install Vue, and execute the following command:
$bower I Vue -- save dev
4. Using Vue can make people feel happy, it has the advantages of both angular and react, lightweight, simple API, complete documentation, simple and powerful, although sparrow is small, it has all five viscera.
If I use one sentence to summarize Vue, then the first thing I think of is the sentence in the official document:
vue.js (pronunciation / vju & # 720; /, Similar to view, it is a progressive framework for building user interface

you may not be unfamiliar with this sentence, but there are not many people who really understand it. In fact, if you understand this sentence, you will understand the core idea of Vue.
so, how to understand what is a progressive framework? Before that, we should first understand what is framework. In the initial front-end development, in order to complete a certain function, we need to obtain DOM node in HTML page through JS, and then obtain the text content in DOM node or add events on DOM node to carry out a series of program operations. However, if the task load is large, the, The code will become bloated and confused with the increase of business. In the real development, the logic and huge amount of development can not be completed by native JS.
at this time, developers divide JS code into three parts: model, logic control (*), view. The data part is only responsible for the data part, and the view part is responsible for changing the style, Logic control is responsible for connecting the view plate and the data plate, which has great advantages. When the demand changes, you only need to modify the corresponding plate

this development mode is the so-called MV structure. We now know that MVC, MVP and MVVM are all derivatives of MV. Comparing these framework modes, we will summarize an essential feature, Compared with the operation of getting DOM with native JS, you will find that the native DOM flow actually takes DOM as data, gets model from DOM, and then changes DOM to update the view. The view and model are mixed together, so the code is naturally confused, It is not easy to maintain.
in Vue instances with responsive systems, DOM state is just a mapping of data state, that is, UI = VM (state). When the state on the right side of the equation changes, the UI of the page display will change accordingly. This is why many people find Vue easy to use when they first start Vue. However, the core positioning of Vue is not a framework, and the design does not fully follow the MVVM pattern. We can see that there are only two parts in the diagram: state and view. The core function of Vue emphasizes the mapping from state to interface, and it does not pay attention to the structural organization of code, Therefore, when only using its core functions, it is not a framework, but more like a view template engine, which is why Vue developers name it as similar to view in pronunciation.
5.

In the past two years, the front-end technology changes too fast. Vue is becoming more and more popular no matter for web project development, website proction, or app and small program development. Its convenience and ease of use make you have to consider learning. If you just build and imitate the traditional CMS open source code, obviously your technology can't keep up with you. If you develop projects with more data interaction and obvious separation between the front and back ends, Vue will make you the best choice for the rapid development of technology in the future

< UL >
  • componentization: the Componentization of react is the most thorough, even to the atomic component at the function level. A high degree of componentization can make our project easy to maintain and expand

  • Natural layering: in the jQuery era, most of the code is noodle code, with serious coupling. Modern frameworks, whether MVC, MVP or MVVM, can help us layering, making code decoupling easier to read and write

  • Ecology: at present, the mainstream front-end frameworks have their own ecology, and there are mature solutions for both data flow management architecture and UI library

  • 6. First of all, what is the MVx framework pattern< MVC: model + view + controller, mainly based on the purpose of layering, to separate the responsibilities of each other
    View connects with model through controller. Controller is the coordinator of view and model. View and model are not directly connected, and the basic connection is one-way
    the user operates the template model through the controller to change the view
    2. MVP: it is evolved from MVC mode, and is responsible for logic processing through controller / presenter + data provided by model + view for display
    in MVP, the presenter completely separates the view from the model, and the main program logic is implemented in the presenter
    in addition, the presenter and view are not directly related, but interact through the defined interface, so that the presenter can be kept unchanged when changing the view
    framework of MVP pattern: Riot, JS
    3. MVVM: MVVM changes the controller in MVC and the presenter in MVP to ViewModel. Model+View+ViewModel
    changes in view will be automatically updated to ViewModel, and changes in ViewModel will be automatically synchronized to view
    this automatic synchronization is e to the fact that the properties in ViewModel implement observer, which can trigger the corresponding operation when the properties change
    the framework of MVVM mode includes angularjs + vue.js and knockout + ember.js, the latter two are less well-known and early rising
    what is vue.js
    after seeing the above introction of framework pattern, we can know that it belongs to MVVM pattern. What are its characteristics
    in fact, vue.js is not a framework, because it only focuses on view layers and is a library for building data-driven web interfaces
    vue.js provides efficient data binding and flexible component system through simple API< The features of vue.js are as follows:
    1. Lightweight framework
    2. Bidirectional data binding
    3. Instructions
    4. Plug in
    what is the difference between vue.js and other frameworks< Different from angularjs,
    the same point:
    both support instructions: built-in instructions and custom instructions
    both support filters: built in filters and custom filters
    both support bidirectional data binding
    does not support low-end browsers
    differences:
    1. Angularjs has a high learning cost, such as adding the dependency injection feature, while the API provided by vue.js is relatively simple and intuitive
    2. In terms of performance, angularjs relies on dirty data checking, so the more watchers, the slower
    vue.js uses dependency tracking based observations and asynchronous queue updates. All data is triggered independently
    for large applications, the optimization difference is obvious
    2. Differences from react:
    similarities:
    react adopts special JSX syntax, vue.js also advocates writing. Vue special file format in component development, and has some conventions on file content, both of which need to be used after compilation
    the central idea is the same: everything is a component, and component instances can be nested
    all of them provide reasonable hook functions for developers to customize their requirements
    no column count, AJAX, route and other functions are built into the core package, but are loaded in the form of plug-ins
    mixins are supported in component development
    differences:
    react relies on virtual DOM, while vue.js uses DOM template. The virtual DOM used in react will do dirty check on the rendered results
    vue.js provides instructions, filters, etc. in the template, which is very convenient and fast to operate dom
    how to use vue.js
    1. Install
    (1) script
    if the project loads the CDN file directly through script, the code example is as follows:
    & lt; script src="& quot;& gt;& lt;/ script>
    (2) NPM
    if the project is given NPM management dependency, then NPM can be used to install Vue, and execute the following command:
    $NPM I Vue -- save dev
    (3) bower
    if the project is based on Bower management dependency, bower can be used to install Vue, and execute the following command:
    $bower I Vue -- save dev
    7. MV * includes MVC, MVP and MVVM
    MVVM framework is composed of model, view and ViewModel
    model refers to data, and the front end corresponds to JavaScript objects
    view refers to the view. At the front end, it corresponds to DOM
    ViewModel, which can be updated by observing the changes of model and view, realizing the bidirectional binding of data
    the front-end MVVM framework mainly includes: angularjs, reactjs and vuejs
    8. MV * includes MVC, MVP and MVVM
    MVVM framework is composed of model, view and ViewModel
    model refers to the JavaScript image of the data front end
    view refers to the dom of the view front end
    ViewModel observes the changes of modelview to achieve bidirectional data binding
    front end MVVM framework mainly includes: angularjs, reactjs and vuejs
    Hot content
    Inn digger Publish: 2021-05-29 20:04:36 Views: 341
    Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
    Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
    Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
    Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
    Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
    Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
    Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
    Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
    Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750