Teleport in Vue 3 with Example

Teleport in Vue 3 with Example

Creating the web pages using components is a good idea. So that we can re-use the logic and structure of the design. We have to make a component hierarchy or tree to make the UI better. In Vue.js we are using template string or render function to build the HTML DOM in the components. The Vue compiler will compile it and make the div elements for us However, sometimes logically, we need one component which could be a child to…

Read More Read More

React Best Free Admin Dashboard Template in 2021

React Best Free Admin Dashboard Template in 2021

React Templates React Templates are web pages which are already developed and well tested User Interfaces(UI Page) using React.js. Creating applications from scratch always has some side effects. Instead of that, we can use the Standard Templates which are already built and used by thousands of customers. Long ago, we used plain HTML and CSS to design the web pages. But today by evolution, we are all using rich front end libraries and frameworks to design the web pages. Among…

Read More Read More

Dynamic Component With Cloning Example Vue.js

Dynamic Component With Cloning Example Vue.js

Nowadays, web developers prefer components to build the web pages effectively. Splitting the UI into reusable pieces is the goal of component creation. Each component will render specific predefined HTML design. There is no problem when the component is static. But sometimes based on condition or scenario, we have to render different components dynamically. To achieve this without using routing, Vue.js provides a special feature for us – Dynamic Components. Let’s take a deep dive to understand it clearly. If you…

Read More Read More

Template Refs in Vue.js

Template Refs in Vue.js

Sometimes while creating components, we need to access its child components or child HTML elements directly in the JavaScript. Though we are having props and events for creating communication with child components, Vue.js provides the special attribute ref. We can create a reference variable using the ref attribute for child components/elements. During the virtual DOM mounting process, if the V-Node(HTML element or child component) has a ref attribute then the respected element or component instance will be stored under the…

Read More Read More

Lifecycle hooks in Vue 3

Lifecycle hooks in Vue 3

In the modern programming world, creating web pages using HTML directly is not very effective. Rather people prefer Components to create HTML web pages. Because the components ease the development, performance and readability. We can divide the web pages into pieces of components. Each Component is responsible for its own business. While we create components, we will go step by step procedure to fulfill its requirements. In Vue.js we can derive this as follows, Data observation template compilation mount the…

Read More Read More

Provide And Inject in Vue.js

Provide And Inject in Vue.js

Provide and Inject are the advanced concepts of Vue.js Components module. It’s not mostly needed for small structured components. But imagine if the structures are deeply nested. Then we are in need to pass data from parent to innermost child component. It’s a completely difficult situation right now. To solve this problem, Vue.js introduced Provide and Inject concepts. Here the parent component provides the dependency to all its children irrespective of how long the component hierarchy is. As the name…

Read More Read More

getCurrentInstance in Vue 3

getCurrentInstance in Vue 3

Being developers we all used to work with this reference in programming. In Vue.js 2, this instance is available in option objects. We can access this inside the method, computed, watch and data. But when it comes to Vue.js 3 it is all about composition API. In the composition API we will be using setup to compose or organize our component business logics. Here, this will not be available inside the setup hook. Because the component is not created yet….

Read More Read More

Computed in Vue 3

Computed in Vue 3

Vue.js has six options which are data, props, computed, methods, watch and emits. Among them, we are going to discuss about computed in vue 3 options. We can use this option while creating the components. It will ease the complex component creations and logics. We can write or compose a component logics using computed. In Vue.js 2, we will use computed as a property of SFC’s. But Computed in Vue 3 moved to separate module. So we have to import…

Read More Read More

Setup function in Composition API – Vue 3

Setup function in Composition API – Vue 3

In Vue.js 2, Component objects could have data, computed, methods, and watch options. We will be using these options to write component functional logics. But when our component grows bigger, the functional logic also grows. So we end up to write the same logic in different options. Meaning that, we have to write some parts in the data options, some parts in the methods and others(computed, watch) also. So it will be difficult to understand the component core logics, Since…

Read More Read More

Single File Components Vue 3

Single File Components Vue 3

We have learned about components in Components in Vue3 . Here, the components can be registered using either global or local registration. These syntax are designed to suit small sized projects. But when it comes to large sized projects, below problems may happen, Unique component name for each component Since template type is string, poor look for large size templates Failed to apply syntax highlights for template Html(template string) and JavaScript are placed into component objects where CSS left out….

Read More Read More