Create an HTML file using Vue.js via CDN

<!DOCTYPE html> <html lang=”en”> <head>     <meta charset=”utf-8″ />     <meta name=”viewport” content=”width=device-width,initial-scale=1.0″>     <script src=”https://unpkg.com/vue@3/dist/vue.global.js”></script>     <title>Title</title>     <style>     </style> </head> <body>     <div id=”app”>     </div> </body> <script>     const { createApp } = Vue;     const app = createApp({    … Continue reading Create an HTML file using Vue.js via CDN

Benefits of SSR( Server side rendering).

SSR brings several benefits to Next.js applications: Improved SEO: SSR enables search engines to easily crawl and index our pages, leading to better search engine rankings and visibility. Faster initial page load: Pre-rendered HTML is sent from the server, resulting in shorter load times and a better user experience. Enhanced performance on low-end devices: SSR reduces client-side processing,… Continue reading Benefits of SSR( Server side rendering).

Methods and Event Handling in Vue.js

In Vue.js, methods are functions defined within the methods option of a component. They provide a way to encapsulate logic and functionality that can be called in response to events or other triggers. https://v1.vuejs.org/guide/events.html

Mounted Feature in the vue.js.

In Vue.js, the mounted lifecycle hook is one of the lifecycle hooks provided by the framework. Lifecycle hooks are special methods that allow you to perform actions at different stages of a Vue component’s lifecycle. The mounted hook is called after the Vue instance has been mounted, i.e., the component has been inserted into the… Continue reading Mounted Feature in the vue.js.

Perform Actions When Form Elements Lose Focus in Vue 3

Use of @blur in Vue 3: The @blur event listener in Vue 3 is utilized to capture events when an element loses focus. This is particularly useful for scenarios where you want to perform an action or validation after the user has completed input in a field, such as validating a form field or formatting… Continue reading Perform Actions When Form Elements Lose Focus in Vue 3

Example for Custom Email Validation in vue.JS

Html Code: <form id=”app” @submit=”checkForm” action=”https://vuejs.org/” method=”post” novalidate=”true” > <p v-if=”errors.length”> <b>Please correct the following error(s):</b> <ul> <li v-for=”error in errors”>{{ error }}</li> </ul> </p> <p> <label for=”name”>Name</label> <input id=”name” v-model=”name” type=”text” name=”name” > </p> <p> <label for=”email”>Email</label> <input id=”email” v-model=”email” type=”email” name=”email” > </p> <p> <label for=”movie”>Favorite Movie</label> <select id=”movie” v-model=”movie” name=”movie” > <option>Star… Continue reading Example for Custom Email Validation in vue.JS

Conditional Rendering in vue.js

v-if In string templates, for example, Handlebars, we would write a conditional block like this: <!– Handlebars template –> {{#if ok}} <h1>Yes</h1> {{/if}} In Vue.js, we use the v-if directive to achieve the same: <h1 v-if=”ok”>Yes</h1> It is also possible to add an “else” block with v-else: <h1 v-if=”ok”>Yes</h1> <h1 v-else>No</h1> Template V-if Because v-if is a directive, it has… Continue reading Conditional Rendering in vue.js

Differences between VueX and Pinia in vue ?

VueX and Pinia are both state management solutions for Vue.js applications, but they have some differences in their approaches and implementations. VueX: Centralized State Management: VueX provides a centralized state management pattern. It includes a single store that holds the global state for the entire application. Mutations and Actions: It uses mutations to directly mutate… Continue reading Differences between VueX and Pinia in vue ?