You can define nested routes in Vue.js (using vue-router) by chaining each of the routes on the root route. For instance, if there's a route named user/gautam, you can nest…
How to create a drag and drop list in Vue.js | Example
You can easily create a drag-and-drop list where you can drag one item and drop it in a different position in within the list. The fastest and easiest way to…
How to register a component locally in Vue.js | Example
Earlier we've seen how we can register a component globally so that we don't have to import it everywhere. However, with that approach, we include the component code everywhere even…
How to use a component without importing in Vue.js | Example
You can use a component anywhere in your application without importing by registering the component globally. You should keep in mind it's drawback though. When you register a component globally,…
How to cache static content in Vue.js | Example
Caching can greatly help with your application performance. As far as template data, you can easily cache the rendered content using v-once if it doesn't need to be changed or…
How to bind components dynamically in Vue.js | Example
Using v-if and v-show directives is probably the most popular way to hide or show a component. These directives in Vue actually gains more popularity as it is missing in…
How to access parent component from child in Vue.js | Example
A child component can access the parent component when the child is placed in the following fashion: <parent> <child></child> </parent> I'm demonstrating the same here with a code example. Let's…
How to access the root instance in Vue.js | Example
Vue is highly flexible as compared to other frameworks of same type. One of it's biggest feature is it's ability to access the root instance and derive methods or computed…
Header, footer and main layout with v-slot in Vue.js | Example
v-slot's in Vue.js is same as passing a child element in React.js. The slots will have all its own properties along with the properties elements being passed to it. v-slot's…