vue should not laugh jquery

My eyes jquery:

  Smooth out differences in type of browser

    Do not say

  It provides a wealth of convenient operation dom

    js obscure native api, jquery js apart apart like java c ++.

  Js capacity expansion

    This is much like the current loadsh

  Provide basic functionality

    It provides the basis for support ajax, event mechanisms

  Plug-in mechanism

    Build a complete ecosystem through plug-in mechanism

 

What jquery that?

  The operation utils jquery dom function, and other network-based request support layer such that the plug-view frame is a view jquery layer.

 

My eyes vue:

  Two-way binding

    Do not say

  Component Function

    Do not say

  Complete life cycle

    vue provides a mounted computed data props methods and other features that can help us a good organization code, while providing a lifecycle approach allows us to greatly enhance the flexibility of the development time

  Virtual dom

    Not the best optimization dom, but is at least above average

  vue-router

    Select a single page applications

  vuex

    Jquery and the data cache are similar memory usage, but more modular vuex

 

What vue that?

  vue dom operation is a mask, such that the front end to focus on the operation data, through assembly of the routing scheme provides for the development of a new way to view the distal end developer layer

 

What is the difference between jquery and vue?

  Dom operation is a library and the library jquery essentially utils plus support network request

  vue is essentially a dom to provide a shield so that the front end of the operation to focus on the operation of the repository data, while taking advantage of the internal components of the project to achieve the decoupling function.

Are jquery also had this vue assembly program?

  In fact very early jquery provide such an assembly mechanism, which is by jquery plug-in mechanism to achieve.

 

Why would jquery dark and react / vue will be popular?

  Dom rise of mobile terminal such that the operation cost is high, while the distal end projects continue complicated, and not a mandatory jquery to organize the code specification, and the binding mechanism by a bidirectional vue to focus on the front end so that the operation data, at least alleviating some of the complexity of the problem of large-scale projects. A novice using jquery spaghetti code easier to write, while a novice to use vue easily write code logic clear.

 

jquery does not disappear:

  Although we use react / vue, but does not mean we do not need to operate dom, in exceptional circumstances we still need to manually handle dom 'operation, generally we will package its own dom' manipulation library, while the prevalence of functional development, making loadsh this library provides a set of functions became popular, we generally packaged some business functions in their own projects, so dom operating business library + library + axios these scaled-down version of jquery is not it?

 

With vue how we organize own code?

  vue substituted jquery should be two points, a shielding dom operation, improving the overall performance is 2 specifications provide a set of codes, i.e. mvvm.

 

Operating its own library dom, dom modify dataset including class modify modify style modify, etc.

Own a business library: crazy turn as hook axios encryption and decryption environmental testing prototype expansion

A set of basic services, such as local authority services and other data anomalies Services

model layer: the need for a clear model to handle the business logic layer

Layer view: this is vue world, you can mix vuex routing instructions, etc. to optimize your view-level code

 

Obviously, vue only solves part of our problem, jquery did not go away, we can still learn a lot from them.

 

Guess you like

Origin www.cnblogs.com/mrzhu/p/11738871.html