<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Valentine Elum </title>
    <description>The latest articles on DEV Community by Valentine Elum  (@vahlcode).</description>
    <link>https://dev.to/vahlcode</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F287573%2Fd7b207b9-00c4-4b7a-a88e-0c9f69cad9b4.png</url>
      <title>DEV Community: Valentine Elum </title>
      <link>https://dev.to/vahlcode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vahlcode"/>
    <language>en</language>
    <item>
      <title>Building Advanced Components with Event-Driven Data Communication in Vue.js</title>
      <dc:creator>Valentine Elum </dc:creator>
      <pubDate>Fri, 02 Apr 2021 15:28:51 +0000</pubDate>
      <link>https://dev.to/vahlcode/building-advanced-components-with-event-driven-data-communication-in-vue-js-4bmn</link>
      <guid>https://dev.to/vahlcode/building-advanced-components-with-event-driven-data-communication-in-vue-js-4bmn</guid>
      <description>&lt;p&gt;In this article, I'll be taking you through the process of building dynamic and modular parent-child components with event-driven data communication in a Vue application. You'll be learning how to dynamically communicate an application's state to the user on the ui, how to work with custom events in making applications dynamic in Vue.js and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;For you to be able to follow up with this tutorial, you must have the following installed in your machine.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Node.js. Click &lt;a href="https://nodejs.org/en/download/"&gt;here&lt;/a&gt; to learn more.&lt;/li&gt;
&lt;li&gt;Vue CLI. Click &lt;a href="https://cli.vuejs.org/guide/installation.html"&gt;here&lt;/a&gt; to learn more.&lt;/li&gt;
&lt;li&gt;Yarn Package Manager. Click &lt;a href="https://yarnpkg.com/getting-started/install"&gt;here&lt;/a&gt; to learn more.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you have all these installed, fire up your favorite terminal, I'm be using Terminus.&lt;/p&gt;

&lt;p&gt;Run the following command to start a Vue project. Replace &lt;code&gt;components-projects&lt;/code&gt; with your desired project name but make it memorable, so you can easily get back to it tomorrow for any reason.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vue create components-projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next output on the console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;? Please pick a preset:
  vue-default &lt;span class="o"&gt;([&lt;/span&gt;Vue 2] babel, pwa, router, vuex, eslint, unit-mocha, e2e-nightwatch&lt;span class="o"&gt;)&lt;/span&gt; 
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Default &lt;span class="o"&gt;([&lt;/span&gt;Vue 2] babel, eslint&lt;span class="o"&gt;)&lt;/span&gt;
  Default &lt;span class="o"&gt;(&lt;/span&gt;Vue 3 Preview&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;([&lt;/span&gt;Vue 3] babel, eslint&lt;span class="o"&gt;)&lt;/span&gt;
  Manually &lt;span class="k"&gt;select &lt;/span&gt;features
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the prompt, use arrow-down key to select the &lt;strong&gt;Default ([Vue 2] babel, eslint)&lt;/strong&gt; option and hit enter! Wait for the installation to finish.&lt;/p&gt;

&lt;p&gt;When it's done installing, follow the instruction to switch into your project folder and run  &lt;code&gt;yarn serve&lt;/code&gt; to serve your project! If you did this well, your project should be running on port 8080, open your browser and visit &lt;code&gt;http://localhost:8080&lt;/code&gt; to view your project.&lt;/p&gt;

&lt;p&gt;Change the content of the App.vue file inside the src folder the one below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Hello World&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#app&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"Poppins"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-font-smoothing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;antialiased&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;-moz-osx-font-smoothing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grayscale&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#2c3e50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#eff7ff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically, I removed the default stylings and components in the file and changed it to mine, this is to enable me style the app to my taste for future purposes.&lt;/p&gt;

&lt;p&gt;When you save the file and open your development server on the browser which is normally &lt;code&gt;http://localhost:8080&lt;/code&gt; for Vue.js projects, you should see a page with 'Hello World' at the center of it and light background color. Let's continue!&lt;/p&gt;

&lt;h2&gt;
  
  
  Building dynamic and modular components for a task management app
&lt;/h2&gt;

&lt;p&gt;We'll be building a task management app (another to-do app? :)). In this project, you'll learn how to build dynamic and modular components with event-driven data communication from child to parent and vice-versa. We'll be making use of props and the Vue &lt;code&gt;$emit&lt;/code&gt; api to communicate our custom change event to complete and oncomplete our tasks in the app.&lt;/p&gt;

&lt;p&gt;Without wasting time, go to your &lt;code&gt;components&lt;/code&gt; directory under the &lt;code&gt;src&lt;/code&gt; directory of your project folder, create a new Vue component file and name it &lt;code&gt;Task.vue&lt;/code&gt; and another component file with name, &lt;code&gt;Tasks.vue&lt;/code&gt;. The Task component will be for individual tasks while the Tasks component will be the parent component for each tasks which will pass the task data down to each Task component.&lt;/p&gt;

&lt;p&gt;Now, paste the following codes into the &lt;code&gt;Task.vue&lt;/code&gt; component file and I'll explain what are in the codes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list-item"&lt;/span&gt; &lt;span class="na"&gt;:class=&lt;/span&gt;&lt;span class="s"&gt;"task.done ? 'done' : ''"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"handleClick"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    {{ task.title }}
  &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;task&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emitChange&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;emitChange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;$emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style &lt;/span&gt;&lt;span class="na"&gt;scoped&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nc"&gt;.list-item&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;15px&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;45px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="m"&gt;#f1f1f1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;list-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.list-item.done&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;line-through&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.list-item&lt;/span&gt;&lt;span class="nd"&gt;:last-of-type&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;border-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.list-item&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#eff7ff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.list-item.done&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#268aee&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Explaining the Task.vue files
&lt;/h2&gt;

&lt;p&gt;In the Task.vue file, we have a &lt;code&gt;template&lt;/code&gt; section which contains the markup of our individual tasks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list-item"&lt;/span&gt; &lt;span class="na"&gt;:class=&lt;/span&gt;&lt;span class="s"&gt;"task.done ? 'done' : ''"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"handleClick"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    {{ task.title }}
  &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the template section, contains a html li tag, with the task, some classes and a click event listener. Based on the status of the task (done/undone), we bind a class to the li tag so we can easily tell the status (done/undone) of the task in the ui using CSS.&lt;/p&gt;

&lt;p&gt;Inside the script section is where our component logic happens. Inside the section, we write the JavaScript codes using Vue APIs to make our component dynamic. Inside the section looks as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;task&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emitChange&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;emitChange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;$emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First, you'll see the props, this is where you register the properties of a component, read about props in Vue.js &lt;a href="https://vuejs.org/v2/guide/components-props.html"&gt;here&lt;/a&gt;. In our Task component we'll be receiving a prop named task which will be an Object of the task to be rendered in the UI.&lt;/p&gt;

&lt;p&gt;Next comes the methods, in a Vue.js component this is where you write functions that will be used inside the component. There are three methods in our component, the first is the &lt;code&gt;handleClick&lt;/code&gt; method which handles click event on the li tag, this happens when a user of our app wants to complete or oncomplete a task.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emitChange&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;handleClick&lt;/code&gt; calls a function that emits a &lt;code&gt;change&lt;/code&gt; event using the Vue.js &lt;code&gt;$emit&lt;/code&gt; API, the emitted event will be handled by the parent component of this very component, the &lt;code&gt;Tasks.vue&lt;/code&gt; component which we will be working on very shortly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;emitChange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;$emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So when the method is called, we get the id of the current task, and emit a change event passing the id as the handler's parameter. This methods creates awareness to the parent component that the user wants to mark a task as done/undone and calls the specified event handler on the parent component passing the id as the handler's parameter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Tasks.vue Component
&lt;/h2&gt;

&lt;p&gt;Next on our task management app, we're going to start writing our &lt;code&gt;Tasks.vue&lt;/code&gt; component which will be the parent component of our &lt;code&gt;Task.vue&lt;/code&gt; component. Copy and paste the below code into the &lt;code&gt;Tasks.vue&lt;/code&gt; file which you created earlier and I'll explain what's in it very shortly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list-items"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;My Tasks&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"tasks"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;Task&lt;/span&gt;
        &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"task in tasks"&lt;/span&gt;
        &lt;span class="na"&gt;:key=&lt;/span&gt;&lt;span class="s"&gt;"task.id"&lt;/span&gt;
        &lt;span class="na"&gt;:task=&lt;/span&gt;&lt;span class="s"&gt;"task"&lt;/span&gt;
        &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;change=&lt;/span&gt;&lt;span class="s"&gt;"handleChange"&lt;/span&gt;
      &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Task&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Task.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Task&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;handleChange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style &lt;/span&gt;&lt;span class="na"&gt;scoped&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nc"&gt;.list-items&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.list-items&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;h3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;25px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.list-items&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;.tasks&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;#e1f0ff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Explaining the Tasks.vue files
&lt;/h2&gt;

&lt;p&gt;In the &lt;code&gt;Tasks.vue&lt;/code&gt; file, we have a &lt;code&gt;template&lt;/code&gt; section which contains the markup of our tasks. Inside it, we loop through our tasks a property in the data (I'll touch this shortly), and render each task in the ui using the &lt;code&gt;Task&lt;/code&gt; component we created earlier .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list-items"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;My Tasks&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"tasks"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;Task&lt;/span&gt;
        &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"task in tasks"&lt;/span&gt;
        &lt;span class="na"&gt;:key=&lt;/span&gt;&lt;span class="s"&gt;"task.id"&lt;/span&gt;
        &lt;span class="na"&gt;:task=&lt;/span&gt;&lt;span class="s"&gt;"task"&lt;/span&gt;
        &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;change=&lt;/span&gt;&lt;span class="s"&gt;"handleChange"&lt;/span&gt;
      &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the &lt;code&gt;Task&lt;/code&gt; component, we pass the task and also listen for a change event. Remember that this event occurs when our app user clicks on the li tag inside the Task component, it happens when our app users wants to change the status of a task by clicking on it to toggle done and undone.&lt;/p&gt;

&lt;p&gt;The click event listener has a handler, &lt;code&gt;handleClick&lt;/code&gt; that calls a function &lt;code&gt;emitChange&lt;/code&gt; that emits a change event on the &lt;code&gt;Task&lt;/code&gt; component.&lt;/p&gt;

&lt;p&gt;So, when this event is emitted, &lt;code&gt;handleChange&lt;/code&gt; method is called on the parent component, this method does the actual work of changing the status of the task with the id passed to it, to the opposite. Below is the &lt;code&gt;handleChange&lt;/code&gt; codes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;handleChange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code above, we filter the tasks for the task(s) with the id passed to the function as parameter, thanks to the fact that each tasks has a unique id, the return will be an array of object(s) with a single object in it. By appending &lt;code&gt;[0]&lt;/code&gt; at the end of the filter method, we selected the first item in the returned array.&lt;/p&gt;

&lt;p&gt;Inside this component, we have a data mockup for our tasks, in a real-world project you'll be fetching the data from an API, but for the sake of learning, we'll quickly use a mockup. Below is the mocked up data in the &lt;code&gt;Tasks.vue&lt;/code&gt; component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* .......... */&lt;/span&gt;
&lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design a components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="cm"&gt;/* .......... */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The data above is an array of tasks, each task has an id (Number), a title (String), and a done status (Boolean).&lt;/p&gt;

&lt;p&gt;In the first three lines inside the script section, we imported our child component which we created earlier and registered it for use in the parent component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Task&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Task.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Task&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="c1"&gt;// ............&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next in the file is our CSS styles for the component, I won't be going into this for now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing our app
&lt;/h2&gt;

&lt;p&gt;It's time to see our unicorn prototype :). Now, we are going to import and register the &lt;code&gt;Tasks&lt;/code&gt; component for use in our App.vue component. We're going to do this the way components are being imported nd registered in Vue inside the script section. Update the script section in App.vue file with the one below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Lists&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components/Lists.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Lists&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, update the template section in App.vue file with the one below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;lists&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, save the changes and check your browser, if you followed me well, your screen should look like in the picture below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm5hee99qjjv5suwvh5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm5hee99qjjv5suwvh5k.png" alt="Alt Text" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should see a heading that says 'My Tasks' and list of tasks. Any completed task has a strike-through text decoration and a blue circle on it's left. The uncompleted tasks, has a different look, it has a light blue circle on it's left and has no strike-through text decoration. Thanks to CSS, we're able to differentiate the states in the UI.&lt;/p&gt;

&lt;p&gt;You should also see that when you click on a task, the UI changes, that is because the status of the task (done/undone) get changed by the &lt;code&gt;handleChange&lt;/code&gt; method. You remember? Yes!&lt;/p&gt;

&lt;p&gt;For example, if you click on the first task which is done, the done status will change to false on the background and the UI will change with a subtle transition.&lt;/p&gt;

&lt;p&gt;Before clicking the task:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffll3nl37xzq142kwzwpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffll3nl37xzq142kwzwpg.png" alt="Alt Text" width="546" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After clicking the task:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgkp6grnfk05vmj8jecy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgkp6grnfk05vmj8jecy.png" alt="Alt Text" width="546" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this project, we created a dynamic component that renders a list (a task), it receives a prop (an object containing the task, it's id and it's done status) and when a user wants to change the task' status, they click on the task and the status gets toggled.&lt;/p&gt;

&lt;p&gt;When a task is clicked, on the background, the component emits an event, a change event telling the parent component that the status of the task needs to be changed. The parent component then handles the event.&lt;/p&gt;

&lt;p&gt;The idea behind this is to create event-driven data communication between components, parent and child. This idea can be used in different use cases, you can use it to create modular, custom and dynamic drop-down, drawer and pop-up ui components having features like value change, open and close toggles, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Vue.js Guide on Props: &lt;a href="https://vuejs.org/v2/guide/components-props.html"&gt;Read Here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Vue.js Components Basics: &lt;a href="https://vuejs.org/v2/guide/components.html"&gt;Read Here&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can find the codes for this tutorial &lt;a href="https://github.com/vahlcode/donnify-app/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;View the app we built live &lt;a href="https://donnify.vercel.app/"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>vue</category>
    </item>
    <item>
      <title>BOOK REVIEW: FRONTEND DEVELOPMENT PROJECTS WITH VUE JS</title>
      <dc:creator>Valentine Elum </dc:creator>
      <pubDate>Fri, 29 Jan 2021 12:44:37 +0000</pubDate>
      <link>https://dev.to/vahlcode/book-review-frontend-development-projects-with-vue-js-396o</link>
      <guid>https://dev.to/vahlcode/book-review-frontend-development-projects-with-vue-js-396o</guid>
      <description>&lt;p&gt;I reviewed one of the latest work by Packt; Frontend Development Projects with Vue.JS. I was supposed to finish the book before now but I was handling a client's project at the time the book came in and I wanted to finish the book and give my honest feedback. I'll be giving my honest feedback, let's get started!&lt;/p&gt;

&lt;p&gt;I have read books about Vue JS and have also practiced Vue JS, in fact, Vue JS is my favorite frontend development framework considering that I've worked with other frameworks/libraries. I've used React JS, I chose Vue because of everything! I love the community, it's so welcoming, the documentation, the design and architecture. You must have felt any of these things before deciding to learn Vue, it's the future!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Who is this book for?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This book is completely designed to help people who wants to get started building Vue.js projects learn and start building with the framework, the book has the essential theories and exercises. It can also be used by mid-level Vue.js developers and advanced Vue.js developers for reference purposes and to discover new and better ways to write Vue. The knowledge packed in this work can be benefitted by anyone who has interest in learning and getting better at Vue.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;So what's in this book?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This book is a fourteen chapters book with a total of 775 pages (including Appendix and Index) covering Vue.js from beginner to advanced level, the book contains comparisons and basic to advanced Vue.js concepts. The summary is as follows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Introduction to Vue.js&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setting up a development environment for Vue.js development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comparing Vue.js with other frameworks/libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Introduction to components in Vue.js.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Styling and using template in Vue.js components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vue directives.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Two-way data binding (working with forms).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Methods in Vue components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vue lifecycle hooks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Working with data, computed props, watchers and methods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Asynchronous data fetching using methods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creating Vue projects using Vue CLI and Vue UI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Debugging Vue.js application using Vue.js Devtools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced Vue.js concepts; Component Modularity (props, slots, filters, refs, emitting parent components events from child components), Mixin, Plugin and a bunch of other concepts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Routing (vue-router).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Animating and transitioning State and route using CSS and GSAP.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;State management with Vuex (beginner and advanced level).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unit and End-To-End testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment, preparing you app for deployment, continuos deployment using git and how to deploy using platforms like Netlify, AWS using S3 and Cloudfront.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How Chapters are Structured&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Each chapters in this book contains an introduction to the topic being discussed in the chapter, the content itself, screenshots, code samples, exercise, activity and summary.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Projects in this book&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;There are bunch of exercises used for the purpose of demonstrations in this book, making the book more of a practical one. The code bundles can be downloaded online so you can practice and follow along. There are also advanced projects used to demonstrate advanced topics like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Exercise 2.01 and 2.02: Working with data, computed props and two way data binding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 2.03 (Shop Watcher) and 2.04: Using Watchers in Vue.js.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 2.05: Handling search functionalities using a Vue Method, a Watcher, and Computed Props in Vue.js:.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 2.06: Asynchronously fetching data from an API using axios and displaying it using computed props in Vue.js.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 3.01 and 3.02: Setting up a Vue.js project using Vue CLI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 3.03: Setting up a Vue.js project using Vue UI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 3.04: How to debug a Vue.js application using Vue.js Devtools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 4.01: Building your a modular component.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 4.02: Passing dynamic props to a component.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 4.03: Props validation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 4.04: Implementing a card component using named slots.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 4.05: Implementing filter in Vue.js.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 4.06: Wrapping CountableJS with Vue.js (using Refs in Vue).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 5.01: Creating a Mixin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 5.02: Creating a custom Axios Plugin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 6.01: Implementing and adding a message feed page using Vue Router.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 6.02: Adding a navigation link to the message feed route.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 6.03: Passing the content of the selected message to a new message page and having it displayed on the page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 6.04: Extracting a messages list to an external Javascript file and loading it only when MESSAGEFEED route is in vue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 6.05: Implementing route for each message with a dynamic routing pattern.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 6.06: Building navigation tabs within the message Vue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 7.01: Adding a new message with an animation effect.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 7.02: Sorting a list of messages with an animation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 7.03: Creating a transition effect for each route navigated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exercise 7.04: Tweens with GSAP.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And many other exercises.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Now let me comment...Why not?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This body of work is just another great effort made in teaching Vue.js the right and effective way. This work and works like Vue.js Up and Running by Callum Macre (O'Reilly Media) are the kind of books that really teaches you instead of wasting your time, you know those kind of books that keeps you focused on reading them and then after the whole journey you find out that you can't even do a thing or two and that's because they were more of interesting theories and less exercises.&lt;/p&gt;

&lt;p&gt;This book is worth trying out and it cost around 39.99 USD (Print + eBook) and 27.99 USD (eBook) on Amazon. I recommend it for beginners, professionals and backend developers looking to get their hands on frontend development.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>frontend</category>
      <category>beginners</category>
      <category>books</category>
    </item>
    <item>
      <title>You should know these things before contributing to an open source project</title>
      <dc:creator>Valentine Elum </dc:creator>
      <pubDate>Thu, 13 Aug 2020 15:32:10 +0000</pubDate>
      <link>https://dev.to/vahlcode/you-should-know-these-things-before-contributing-to-an-open-source-project-3ppp</link>
      <guid>https://dev.to/vahlcode/you-should-know-these-things-before-contributing-to-an-open-source-project-3ppp</guid>
      <description>&lt;p&gt;In this post, I'll be showing you things you should know before contributing to an open source project. I learnt these things and I'll be showing them to you on this short post. &lt;/p&gt;

&lt;p&gt;Before making a pr, there are things you should ensure that your changes meet, these things helps save time for everyone working on the project and helps avoid problems. They're:&lt;/p&gt;

&lt;h3&gt;
  
  
  Adhere to the project's rule.
&lt;/h3&gt;

&lt;p&gt;Many projects has rules that guides them, they maybe where to place media files, how to edit files like a JSON file containing data used by those projects. &lt;/p&gt;

&lt;p&gt;When contributing to such projects, try to go by those rules as they are often the foundations of the projects.&lt;/p&gt;

&lt;p&gt;Any deviance from the rules will cause problems and your changes won't be merged until corrected. &lt;/p&gt;

&lt;h3&gt;
  
  
  Be descriptive with your commit messages.
&lt;/h3&gt;

&lt;p&gt;After making an improvement to a project, try as much as possible to explain what you did in the commit message.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understand before writing.
&lt;/h3&gt;

&lt;p&gt;Try as much as possible to understand the project you're trying to improve before making a change.  &lt;/p&gt;

&lt;p&gt;Understand the file structure and how the files depends on each other. &lt;/p&gt;

&lt;p&gt;If you don't understand the project you'll have a hard working on the project. &lt;/p&gt;

&lt;p&gt;That's it. Thanks reading through. I welcome your contribution. &lt;/p&gt;

</description>
      <category>opensource</category>
      <category>javascript</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>After Installing Wordpress What's Next?</title>
      <dc:creator>Valentine Elum </dc:creator>
      <pubDate>Wed, 17 Jun 2020 11:01:00 +0000</pubDate>
      <link>https://dev.to/vahlcode/after-installing-wordpress-what-s-next-6ae</link>
      <guid>https://dev.to/vahlcode/after-installing-wordpress-what-s-next-6ae</guid>
      <description>&lt;p&gt;In this post, I'll be giving tips on what to do after installing Wordpress to enable you build awesome websites. &lt;/p&gt;

&lt;p&gt;Wordpress as we know is an awesome and one of the most used content management system. With good practices, designers and developers build fast, secure and good looking websites in a short period of time. &lt;/p&gt;

&lt;p&gt;I have been doing it and I'll be showing you how I've been able to build awesome websites with Wordpress. Let's get started. &lt;/p&gt;

&lt;h1&gt;
  
  
  After Installation
&lt;/h1&gt;

&lt;h3&gt;
  
  
  I uninstall the default themes
&lt;/h3&gt;

&lt;p&gt;After installing Wordpress, the first thing I do is cleaning up the default themes. &lt;/p&gt;

&lt;h3&gt;
  
  
  Why do I uninstall the default themes?
&lt;/h3&gt;

&lt;p&gt;There are many reasons I do this, in fact it's a good thing to do. It allows me have only the theme I need to build my website. &lt;/p&gt;

&lt;p&gt;For instance, I normally use the Elementor page builder to build custom websites with Wordpress, using Elementor automatically requires a theme that gives you the flexibility to build on top of it and also light in weight.&lt;/p&gt;

&lt;p&gt;For the above reason, I either choose &lt;strong&gt;&lt;em&gt;Astra&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;Hello&lt;/em&gt;&lt;/strong&gt; theme, both themes are light in weight and gives you the flexible feature you need to build on them. &lt;/p&gt;

&lt;p&gt;Like I said, I do that because I need something that allows me to easily build with &lt;strong&gt;Elementor&lt;/strong&gt;. Some of you will likely use ready-made themes. It's up to you. But whatever theme you choose to use be mindful of your site performance. &lt;/p&gt;

&lt;h3&gt;
  
  
  Installing essential plugins
&lt;/h3&gt;

&lt;p&gt;I love my website when they're fast and secured enough. &lt;/p&gt;

&lt;p&gt;I can deal with not-so fine interface, but when it comes to security and experience, I'm very careful. &lt;/p&gt;

&lt;p&gt;After installing Wordpress, I must get rid of useless default plugins, install the ones that are useful to me. I do this to clean up my website, keep it secured and fast! &lt;/p&gt;

&lt;p&gt;Below are the list of plugins I make use of. &lt;/p&gt;

&lt;h4&gt;
  
  
  1. WordFence or iThemes Security.
&lt;/h4&gt;

&lt;p&gt;Both of them are the Wordpress plugins I recommend for your site's security. Choose any of them. &lt;/p&gt;

&lt;h4&gt;
  
  
  2. WP Optimise or Smush
&lt;/h4&gt;

&lt;p&gt;I use one of these plugins to clean up my database, compress images and cache my site. They're really awesome and has free plans. &lt;/p&gt;

&lt;h4&gt;
  
  
  3. Updraft.
&lt;/h4&gt;

&lt;p&gt;Did I  mention that you can use iThemes for backup? Yeah you can. But I recommend using Updraft. It's an awesome Wordpress plugin for backup. One of the best and most used out there. &lt;/p&gt;

&lt;h4&gt;
  
  
  4. Really Simple SSL.
&lt;/h4&gt;

&lt;p&gt;I use this plugin to ensure that I maintain &lt;strong&gt;&lt;em&gt;https&lt;/em&gt;&lt;/strong&gt; across my website. I strongly recommend this. &lt;/p&gt;

&lt;h4&gt;
  
  
  5. WP Mail SMTP.
&lt;/h4&gt;

&lt;p&gt;With this plugin, I configure WP mail SMTP to send emails from my website. It's very easy to use and it's configuration is magical. &lt;/p&gt;

&lt;h4&gt;
  
  
  6. Elementor.
&lt;/h4&gt;

&lt;p&gt;😍😍😍😍 I so much love this plugin. With it, there are so much to achieve as long as sleek user interface with Wordpress is concerned. It has a very large community and I choose it over other page builders. Try it out. &lt;/p&gt;

&lt;p&gt;These are the most essential plugins for my Wordpress site. I must say that you can use Wordpress plugins to achieve more with Wordpress but more plugins can affect your website in terms of security, speed and entire experience. &lt;/p&gt;

&lt;p&gt;You should be mindful of the plugins you make use of and the amount of plugins installed on your website at a time. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;From what I've written above, it's obvious that my actions after Wordpress installation are channeled towards making my site secured, backed up and optimised for speed. &lt;/p&gt;

&lt;p&gt;I advise you do such. Thanks for reading this post ☺. Your contributions are welcomed. &lt;/p&gt;

</description>
      <category>frontend</category>
      <category>webdev</category>
      <category>wordpress</category>
      <category>php</category>
    </item>
  </channel>
</rss>
