Installing Vue.js

[vc_row][vc_column width=”1/1″][vc_tta_tabs style=”modern” shape=”square” active_section=”1″ css_animation=”bounceIn”][vc_tta_section title=”Tab 1″ tab_id=”1751323679048-d65b517e-3267″][vc_column_text]I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo. 1111111111111111[/vc_column_text][/vc_tta_section][vc_tta_section title=”Tab 2″ tab_id=”1751323679052-b473328f-02fa”][vc_column_text]I am text block. Click edit button to change this text. Lorem ipsum dolor sit … Read more

Custom Vue directives

What are custom directives? A directive is generally some special token in the markup that tells the library to do something with a DOM element. Vue has its own predefined directives but what if we want to do something or perform some action that is not yet explicitly defined with any Vue directive. Vue allows … Read more

What is Vue.js?

What is

Vue 3 note (2026): Vue 3 is the current major version (Vue 2 is EOL). New projects should use Vue 3 + Vite (npm create vue@latest). Options API remains fully supported; Composition API is recommended for complex/new code.

Vue.js?

Vue.js is pronounced /vjuː/, similar to the English word view, and in the official documentation they say it is a progressive JavaScript framework for creating user interfaces.

“Progressive framework for building user interfaces”.
Vue.js documentation

vue.js

Vue.js is considered to be one of the simplest JavaScript frameworks, which is very fast, has a small size and very detailed documentation. Vue.js is very flexible and adaptable to different types of projects. In the basic version, it is practically a library, and as such is applicable for small and medium projects, however, by adding appropriate official components, Vue.js becomes a full framework, and as such has the potential for creating enterprise applications.
Although currently Vue.js is not yet as popular as React (supported by Facebook) or Angular 2 (supported by Google), its popularity is growing day by day, and the Laravel community considers it one of their favorite front-end frameworks.

NOTE:
At the time of writing the current version was 2.0, but later a new version 3.0 was released, for which most of the texts are still valid, but it still brings with it numerous changes (see list of changes on the official website). For the biggest changes, I went back and updated the content of the articles, adding explanations related to the 3.0 version, but not all, so it’s up to the reader to study all the differences.

Read more

Characteristics and specificities of the routes

The “route” object contains all the information about the current route, which can always be accessed from the application through one of its properties:

$route.path – A string equal to the path of the current route, always resolved as an absolute path (eg “/user/profile”).
$route.params – A key/value object used to return data from dynamic routes. If there are no parameters, the value will be an empty object.
$route.query – An object in the form of key/value pairs used to return query string data.
$route.fullPath – full URL including query and hash.
$route.matched – An array containing the path records of the current route
$route.name – The name of the current route if it is defined
$route.redirectedFrom – The name of the route from which the redirection was performed, if there is a redirection

Basics of routing with Vue.js

In web application development, routing is all about user interface separation. Splitting the application into several different pages is necessary for easier viewing of a complex application. In the roughest terms, routing is the definition of rules with the help of which appropriate content is associated with a request submitted by a specific URL address. Routing is often divided into two main sections:

a) Server-side routing
b) Client-side routing

Animate multiple elements at once “transition-group”

List rendering is very often used in programming, the most common being dynamic list rendering when rendering a series of similarly grouped information.
This article explains how to animate such lists with the Vue.js framework. To animate multiple elements, we cannot use the “transition” component, because it can “wrap” ONLY ONE HTML element, therefore Vue.js introduces a new type of wrapper component, called .

Transition when replacing elements with Vue.js

During the transition, the property change on both elements occurs simultaneously. As a result, both elements are visible during the animation (which is not the most beautiful). The new element that has yet to be rendered is always positioned below the disappearing element. It is unnatural that that element comes to the right place only when the first element completely disappears, ie. when the animation is finished (and then the jump of the element is noticed).
In order to avoid this ugly behavior, it is necessary that the disappearing element completely finishes the animation, before the animation of the appearing element starts. Vue.js achieves this by defining the so-called fashion transition.
There are two possibilities for the value of the “mode” attribute:

The basics of animation with Vue.js

Vue.js has mechanisms for easily integrating CSS animation over an HTML element. Vue.js enables CSS animation by automatically adding specific classes to the HTML element at a certain moment of animation, after which we can use them to define CSS properties for animation.
In addition, Vue.js enables animation with JavaScript because with “transition hooks” (“custom events” that are “triggered” by Vue.js according to the determined timing of the animation) it enables the use of JavaScript for direct manipulation of the DOM.
Also with Vue.js there is the possibility to easily integrate 3rd-party CSS animation libraries (eg Animate.css) or 3rd-party JavaScript animation libraries (eg Velocity.js or GreenSock).

Filtering with Vue.js

A Vue filter is essentially a function that takes a value, processes it, and then returns the processed value. Filters are not substitutes for methods, computed properties, or watch properties, because filters do not transform data, but only transform the output that the user sees. Filters can be nested and, like all functions, can take arguments. When a filter is used, its context is set to the instance that refers to it, so the “this” keyword points to it.

Vue.js mixin

What is a mixin?

Vue 3 note (2026): For new Vue 3 code, prefer composables (Composition API functions like useXxx()) over mixins. Mixins still work with the Options API but make dependencies less explicit and are easy to collide.

vue mixin

Mixins are “reusable” pieces of code that can be used multiple times in any Vue component or instance. A Vue.js mixin is actually an object that can contain all the properties as well as the options object of the instance/component: data, methods, computed…
“Mixins” are used for:

  • Creation of common properties (methods, data…), which are used in different components and thus enable compliance with the DRY (“Don’t Repeat Yourself”) principle.
  • When creating plugins that need to modify an existing Vue instance, because they can easily add new functionality.
The domain of the mixin

A mixin is integrated into an instance (component) by embedding a copy of the code written in the mixin into the component. This leads to the conclusion that the code that came into the component from the mixin is completely separate and independent both from the mixin itself and from the code embedded in the other components.

Read more