Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between angular and vue

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what are the differences between angular and vue", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the differences between angular and vue" this article.

Differences: 1, vue occupies less space, and angular is larger; 2, Vue is more flexible than Angular, and can organize the application code of the project according to different needs; 3, vue is easy to learn, angular is more difficult to get started; 4, angular instruction is "ng-xxx", vue instruction is "v-xxx".

The operating environment of this tutorial: windows7 system, vue2.9.6&&angular6 version, DELL G3 computer.

Introduction to Angular

Angular is a JavaScript framework that was originally developed by Misko Hevery and Adam Abrons in 2009 and later became a project of Google.

Angular makes up for the deficiency of HTML in building applications. It expands the HTML vocabulary in Web applications by using directives structure, so that developers can use HTML to declare dynamic content, which makes it easier for Web development and testing.

Characteristics of angularjs:

1, two-way binding of data: the data of the view layer and the data of the model layer are bound bidirectionally, one of which changes, the other side will change accordingly, you don't have to write any code!

2, the code is modular, the code of each module has its own scope, model,controller and so on.

3, powerful directive can encapsulate many functions into HTML tag, attributes or comments, etc., which greatly beautifies the structure of HTML and enhances readability.

4. Dependency injection, which assigns the design pattern of the back-end language to the front-end code, which means that the front-end code can improve reusability and flexibility. The future pattern may put a large number of operations on the client. The server only provides data sources and other operations that cannot be done by the client.

5. Test-driven development, angularjs aims at this from the very beginning. Applications developed with angular can easily carry out unit testing and end-to-end testing, which solves the defect that traditional js code is difficult to test and maintain.

Introduction to vue

Vue (pronunciation / vju steps /, similar to view) is a progressive JavaScript framework for building user interfaces. Unlike other large frameworks, Vue is designed to be applied layer by layer from the bottom up. Vue's core library only focuses on the view layer, which is not only easy to use, but also easy to integrate with third-party libraries or existing projects. On the other hand, when used in conjunction with modern tool chains and various supporting class libraries, Vue is also fully capable of driving complex single-page applications (SPA).

The goal of Vue.js is to implement responsive data binding and composite view components through the simplest possible API.

Vue.js itself is not an omnipotent framework-it only focuses on the view layer. So it is very easy to learn and very easy to integrate with other libraries or existing projects. On the other hand, Vue.js can also drive complex single-page applications when used with related tools and support libraries.

Characteristics of Vuejs:

1. Lightweight framework

2. Bidirectional data binding

3. Instruction

4. Modularization. At present, the hottest way is to use the modularization of ES6 directly in the project, combined with Webpack for project packaging.

5, componentization, to create a single component suffix .vue file, including template (html code), script (es6 code), style (css style).

The difference between angular and vue

1. Volume and performance

Vue takes up less space, such as a Vue project that contains Vuex + Vue Router (30kB after gzip), which is still much smaller than the default project size generated by angular-cli (~ 65KB).

In terms of rendering performance, the two frameworks are very fast, and there is little difference in performance.

2. Development efficiency

Both provide their own scaffolding tools to help improve the whole process from development to build packaging, and can write reusable components based on component-based development, with much less repetitive work. But angular relies on the advantage that Typescript itself is more engineering than JavaScript, in the case of team development, angular will have more advantages.

3. Flexibility

Compared with Angular, Vue is more flexible and can organize the application code of the project according to different needs. For example, you can even reference vue in HTML directly like jquery, and then just use it as a front-end template engine.

4. Maintainability

My understanding of maintainability includes two levels, one is the readability of the code, and the other is reconfiguration. It is also because the support for TS (which provides static type checking) is not comprehensive enough, which makes vue somewhat inadequate at both levels. The author of vue himself admits that vue has some deficiencies in TS support and will be improved in version 3.0.

5. the cost of learning is high.

Vue is easy to learn, but angular is more difficult to use.

The learning cost of AngularJS is high, such as the addition of Dependency Injection features, while the API provided by Vue.js itself is relatively simple and intuitive.

6. Instruction

Angular's instructions are all ng-xxx, while vueJS's instructions are all v-xxx.

These are all the contents of this article entitled "what are the differences between angular and vue". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report