Creating our first component
As you may remember from the first chapter, in which we introduced the Companion App, we are planning to build a clone of the social application called X (former Twitter). To start our building journey in style, we are going to build the most iconic component of the application, a post.
Figure 3.7: Example of a X.com post component
In this chapter, we are going to learn how to switch between the different branches within the book repository. We are then going to create our first SFC (Single File Component) component using the template knowledge we gained in the previous chapter, and we will finish by adding some dynamic content to the component by introducing two Vue reactivity functions, Refs
and Reactive
.
Creating Post.vue
Back in Chapter 1, we mentioned that we were going to break down components into different layers (atoms, molecules, organisms, and so on) and SocialPost.vue
is going to be part of the molecules layer...