VueJS 2.x

I’m trying to use VueJS (Front) + Ruby On Rails 5.x in Backend. I will talk about Rails in some next post… maybe 😆


Why VueJS? well, this project have short scope and like any startup project, must be fast! so, I found Vuetify an amazing library with material directives ready to use. I just has created some Vue component’s, stores and all has been fast since then. The docs is easy to understand and to apply. I just have created the following structure:


Note Templatevuetify.vue component. This is the «common template». The notifications components is attached to this component for all common messages. All rest it’s same! 😀 you know:


<template lang="html">
    <v-navigation-drawer temporary v-model="drawer" :mini-variant="mini" dark :hide-overlay="true">
      <v-list class="pa-0">
        <v-list-tile avatar tag="div">
              <img src="avatar.jpg" />
              <v-list-tile-title>Homero Thomson</v-list-tile-title>
              <v-btn icon dark @click.native.stop="mini = !mini">
      <v-list class="pt-0" dense>
         <v-divider light></v-divider>
         <v-list-tile v-for="item in items" :key="item" @click.native="redirectTo(item.goTo)" v-if="item.roles.includes(currentRole)">
               <v-icon light>{{ item.icon }}</v-icon>
                <v-list-tile-title>{{ item.title }}</v-list-tile-title>
    <v-toolbar fixed light>
        <v-toolbar-side-icon light @click.native.stop="drawer = !drawer"></v-toolbar-side-icon>
    <main class="mh1000">
          <template slot="main-content-notification-success">
          <template slot="main-content-notification-error">
          <template slot="main-content-notification-warning">
          <template slot="main-content-notification-info">
       <v-container fluid>
              enter-active-class="animated fadeInRight"
              <slot name="main-content"></slot>


In api folder we have all request to API using the official library for Vue: Axios. These small objects just call to API and return any response. All treatment of exceptions or error handles is allocated in stores. In stores I included the Notifications, so all the components is mainly independent of all request and errors on responses.
All necessary and recurrent data is stored in each ‘store’, so the application don’t need re-call to API for get data. Later of this, all looks very fast and simple to code level.

After use VueJS 2.x I can say that have the magic of AngularJS 1 and some ReactJS concepts, like components. The learning curve is considerably less than AngularJS 1.x and of course of ReactJS, you know… just I needed 2 days with this tutorial and 1 day for apply Vuetify and some customizations.

The most popular questions for Vue is: is Vue scalable for larger apps? I don’t sure 🤔 I mean, how big are we talking about? I guest it works and we keep simple code and fast application. But definitely it’s much better than AngularJS in many respects.

Do you know to Fattoruso musicians family? You should! 😀


Ricardo Aragón

Ricardo Aragón

Full Stack Developer