Home > Article > Web Front-end > What frameworks are vue and react?
vue is a progressive JavaScript framework for building user interfaces. Vue's core library only focuses on the view layer, and is very easy to learn and integrate with other libraries or existing projects. React is a JavaScript development framework used to build user interfaces, mainly used to build UI.
The operating environment of this article: windows10 system, vue2.9&&react 16, thinkpad t480 computer.
Related recommendations: "React Video Tutorial", "vue.js Tutorial"
What is the framework of vue?
vue.js (pronounced /vjuː/, 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, making it easy to integrate with third-party libraries or existing projects.
Vue.js is a progressive framework for building user interfaces. Unlike other heavyweight frameworks, Vue adopts a bottom-up incremental development design. Vue's core library only focuses on the view layer, and is very easy to learn and integrate with other libraries or existing projects. Vue, on the other hand, is fully capable of driving complex single-page applications developed using single-file components and libraries supported by the Vue ecosystem.
The goal of Vue.js is to enable responsive data binding and composed view components through the simplest possible API.
Compatibility of vue
Vue.js does not support IE8 and below because Vue.js uses ECMAScript 5 features that IE8 cannot emulate. Vue.js supports all ECMAScript 5-compatible browsers.
What is the framework of react?
The react.js framework is a JavaScript development framework launched by Facebook for building user interfaces.
React is a declarative, efficient and flexible JavaScript library for building user interfaces. React allows you to combine short, independent code snippets into complex UI interfaces. These code snippets are called "components".
Because the design idea of React is extremely unique, it is a revolutionary innovation, has outstanding performance, and the code logic is very simple. Therefore, more and more people are beginning to pay attention to and use it, thinking that it may be the mainstream tool for web development in the future.
React is an open source JavaScript library that provides views of data rendered into HTML. React views are typically rendered using components that contain other components specified in custom HTML tags. React provides programmers with a model in which child components cannot directly affect outer components, efficient updates to HTML documents when data changes, and clean separation between components in modern single-page applications.
React makes creating interactive UIs a breeze. Design concise views for every state in your app so React can efficiently update and render components correctly when data changes. Component logic is written in JavaScript rather than templates, so you can easily pass data around your app and keep state separate from the DOM.
Comparison between React and Vue
Similarities:
Vue and react are both JavaScript UI frameworks, focusing on creation Rich applications on the front end. Unlike early JavaScript frameworks that were "full-featured", Reat and Vue only have the skeleton of the framework, and other functions such as routing and state management are components separated from the framework.
Both are JavaScript libraries for creating UI;
Both are fast and lightweight;
all have component-based architecture;
all use virtual DOM;
can be put into a single HTML file. Or become a module in a more complex webpack setup;
has independent but commonly used router and state management libraries;
Difference:
In a React application, when the state of a component changes, it will re-render the entire component subtree with the component as the root. If you want to avoid unnecessary re-rendering of sub-components, you need to implement it manually; in Vue applications, component dependencies are automatically tracked during the rendering process, so the system can accurately know which components really need to be re-rendered, and developers do not need to You need to consider whether the component needs to be re-rendered and other optimizations.
In React, everything is JavaScript, and all components rely on JSX for their rendering functions. JSX is a syntactic sugar for writing JavaScript using XML syntax. You can use the complete programming language JavaScript functions to build your view page; Vue has its own rendering function, and Vue also supports JSX. Vue officially recommends using templates to render views. Components are divided into logical components and presentation components.
CSS within component scope. CSS scope is implemented in React through the CSS-in-JS solution; in Vue it is implemented by adding the scoped tag to the style tag.
Vue’s routing library and state management library are officially maintained and supported and updated synchronously with the core library. React chooses to leave these issues to the community, thus creating a more decentralized ecosystem.
Related recommendations:
2020 front-end vue interview questions summary (with answers)
Vue Tutorial Recommendation: The latest 5 vue.js video tutorial selections in 2020
For more programming-related knowledge, please visit: Introduction to Programming! !
The above is the detailed content of What frameworks are vue and react?. For more information, please follow other related articles on the PHP Chinese website!