Vue — The color of life
The first time I heard about Vue was during a meetup. One of the people there talked about how much she loved Vue. As a naturally curious human being, I registered for the Vuejs meetup the next day. The Vuejs meetup was one of the best meetups I’ve ever been to.
Coming from a React background, I enjoy comparing React and Vue.
- React is founded and maintained by Facebook which is a no surprise. What impressed me about Vue was how it was created by Evan You, a former Google Engineer. He manages all the maintenance of Vue.
- React has JSX which is a way of writing HTML inside JS code. Vue separates HTML, JS and CSS, but it also allows to use JSX. I really like the inline methods of Vue such as:
Instead of writing a long line of mapping through an array, you can use v-for inside an html tag and it will return all the elements in the array:
<ul>
<li v-for="detail in details">{{detail}}</li>
</ul>
Or conditional rendering using if-else inside an html tag:
<p v-if="inStock">In Stock</p>
<p v-else>Out Of Stock</p>
- In my opinion, Vue’s docs are easier to read than React’s.
- Just like create-react-app in React, Vue also has its own scaffold cli:
vue create app-name.
What I find interesting about Vue is Vue has a development environment where you can set up and install all the dependencies without using cli. The UI of the dev mode is very interactive and beautiful.
- React has Redux for state management, Vue has Vuex. Vue also has Vue router for URL management.
- I like the Vue developer tools a lot. Vue expresses its color widely.
Overall, I still can see myself as a React person. But Vue has impressed me with all the UI and features it has. I’m planning to build a project with Vue so I can understand it better. I believe more and more companies will use Vue in the future.