Home > Web Front-end > Vue.js > What are the similarities and differences between vue and react?

What are the similarities and differences between vue and react?

coldplay.xixi
Release: 2020-11-30 13:53:57
Original
2656 people have browsed it

Similarities and differences between vue and react: 1. The similarity is that they are both JavaScript UI frameworks, focusing on creating rich front-end applications; 2. The difference is that react data flow is one-way, while vue data is bound in two directions Certainly.

What are the similarities and differences between vue and react?

[Related article recommendations: vue.js]

vue is similar to react Difference:

Similarities

  • They are both JavaScript UI frameworks, focusing on creating front-end rich applications

  • Different from early JavaScript frameworks that were "fully functional", Reat and Vue only have the skeleton of the framework, and other functions such as routing, state management, etc. are components separated from the framework.

  • One of the biggest similarities between Vue.js (version 2.0) and React is that they both use something called 'Virtual DOM'

  • Both encourage componentization

  • See that both React and Vue have the concept of 'props', which is the abbreviation of properties. Props is a special attribute in a component that allows parent components to pass data to child components.

  • React and Vue both have their own build tools, you can use it to quickly build a development environment

  • Both React and Vue have good Chrome extension tool to help you find bugs.

  • The last thing that is similar but slightly different between Vue and React is the processing method of their supporting frameworks. The similarity is that both frameworks focus on the UI layer, and other functions such as routing and state management are handled by the companion framework.

react

  • One-way data flow

  • React is promoted Virtual DOM, and created a new syntax - JSX, which allows developers to write HTML in JavaScript

  • ##React is also maintained by large companies such as Facebook

  • props are necessary for child components because it relies on a "single data source" as its "state"

  • React can be created using Create React App ( CRA)

  • React's react-router and react-redux are maintained by community members, and they are not officially maintained.

  • The biggest difference between React and Vue is the writing of templates

  • In React you need to use the setState() method to update the state

  • In most cases, the state management built into the framework is not enough to support large-scale applications, and state management solutions such as Redux or Vuex must be used.

vue

  • Data two-way binding

  • Vue uses templates system instead of JSX, making it easier to upgrade existing applications. This is because the template uses ordinary HTML. It is easier to integrate existing systems through Vue without the need for overall reconstruction

  • Vue is mainly maintained by one developer

  • In Vue, props are slightly different. They are also defined in the component, but Vue relies on template syntax. You can display the incoming data more efficiently through the template's loop function.

  • Vue corresponds to vue-cli

  • Vue’s core team maintains vue-router and vuex

  • The biggest difference between React and Vue is the writing of templates

  • In Vue, the state object is not necessary, and the data is managed in the Vue object by the data attribute.

  • Vue's) solution is suitable for small applications, but is not suitable for large applications.

Related free learning recommendations: JavaScript(Video)

The above is the detailed content of What are the similarities and differences between vue and react?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template