Vue 3 — Slot Shorthands

Vue 3 — Slot Shorthands

Various shorthands for using slots.If we have one slot, then we don’t need the template element. We can put the v-slot directive right on the opening component tag.

Shorthand Syntax for Default Slots

If we have one slot, then we don’t need the template element.

We can put the v-slot directive right on the opening component tag.

For instance, we can write:

<!DOCTYPE html>
<html lang="en">
    <script src="[email protected]"></script>
    <div id="app">
      <items v-slot="slotProps">
        <b>{{ }}</b>
      const app = Vue.createApp({});
      app.component("items", {
        template: `
            <li v-for="( item, index ) in items">
              <slot v-bind:item="item"></slot>
        data() {
          return {
            items: [{ name: "apple" }, { name: "orange" }, { name: "grape" }]

We have the v-slot directive on the component tag, which is only allowed when we have one slot in our component.

programming technology javascript vue vuejs

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

8 Popular Websites That Use The Vue.JS Framework

In this article, we are going to list out the most popular websites using Vue JS as their frontend framework. Vue JS is one of those elite progressive JavaScript frameworks that has huge demand in the web development industry. Many popular websites are developed using Vue in their frontend development because of its imperative features.

Vue.js Tab Components Based on Vue Router

vue-router-tab .A tab router component based on Vue Router.

5 JavaScript tips learned from Vue source code

5 JavaScript Tips I Learned From Vue Source Code - Learn JavaScript from the source code of the popular JS frameworks.

Vue Query Builder with Cube.js - A Tutorial

quite commonly in our applications, we need to create interactive report builders to let users build custom reports and dashboards. This usually involves selecting the metrics, groupings, date ranges, filters, and chart types. To help developers build such interactive components, we've created a query builder component in Cube.js client libraries.

Best JavaScript Practices to Adopt in Our Vue Apps

Syntax to avoid and avoiding security vulnerabilities.