mvc It is one-way mvpThe core of MVP lies in the presenter layer. The core of this layer is the operation of DOM elements. Taking the implementation of list page with jQuery as an example, the presenter mainly combines the data in the Model with the HTML tags through a loop and adds them to the View. mvvmThe core of mvvm lies in the Model layer, the core of which is the operation on data. Compared with the mvp mode, our coding focus has shifted from the operation on dom to the operation on data. The VM layer displays data to the view layer and passes the data of the view layer to the Model layer. Vue is a typical example of viewModel The source of VueVue draws on react's virtual dom technology and angular's ng-directive technology spa mpa MPA: multi-page application Features: The first loading is faster, and the subsequent loading is slower. The initial development cost is low, but the later maintenance cost is high. SPA: single page application The first load is slower, and the subsequent loads are faster. The initial development cost is high, but the later maintenance cost is low. (Mainly reused more) createElementvar li = document.createElement(ele,src,content); //ele The element to be created //src The attributes of the element //content The content of the elementvar li = document.createElement('li',{className='list-li'},'123'); <li className="list-li">123<li> classclass Person { constructor(x,y) { this.x = x; } add() { console.log(this.x); } } var person = new Person(1,2); typeof Person // function The essence of the class is a constructor Person === Person.prototype.constructor //true The class points to the prototype of the constructor person.hasOwnProperty(x); //true person.hasOwnProperty(y); //false person.hasOwnProperty(add); // false This in the constructor points to the instantiated object, so x is a property of person and y and add are equivalent to adding to Person.prototype person.__proto__.hasOwnProperty(add) //true The function in the class is equivalent to adding it to the prototype of the constructor. SummarizeThis article ends here. I hope it can be helpful to you. I also hope that you can pay more attention to more content on 123WORDPRESS.COM! You may also be interested in:
|
<<: Detailed explanation of the principle and usage of MySQL stored procedures
>>: Use prometheus to count the remaining available percentage of MySQL auto-increment primary keys
In MySQL, you can use the REVOKE statement to rem...
This article shares the specific code of JS to ac...
Preface: Docker port mapping is often done by map...
It is troublesome to install the db2 database dir...
This article uses examples to illustrate the usag...
Table of contents Controller type of k8s Relation...
1. CSS Miscellaneous Icons There are three ways t...
Now 2016 server supports multi-site https service...
As of now, the latest version of CentOS is CentOS...
Table of contents 1. Interface definition 2. Attr...
introduction I used postgresql database for some ...
Overview: Oracle scott user has four tables, whic...
1. Installation environment Docker supports the f...
Abstract: Whether at work or in an interview, opt...
Install MySQL and keep a note. I don’t know if it...