{"id":33171,"date":"2024-05-24T10:38:44","date_gmt":"2024-05-24T08:38:44","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=33171"},"modified":"2024-05-24T10:38:47","modified_gmt":"2024-05-24T08:38:47","slug":"how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/","title":{"rendered":"How to Use Dynamic Slots in Vue.js with Vuetify Data Table"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-introduction\">Introduction<\/h2>\n\n\n\n<p>In this tutorial, we will explore how to use dynamic slots in Vue.js with Vuetify data table. Firstly, we will start with a CompDataTable.vue component and demonstrate how to define and use custom slots to dynamically customize the content of a data table. Additionally, we will explain how the dynamic slots work.<\/p>\n\n\n\n<p>I\u2019m not going to create a Vue.js project from scratch. Instead, I will use a Vuetify playground. You can also try the content of this blog without creating a local Vue.js project. Specifically, I\u2019m going to use the playground available for the Data table <code>Server-side paginate and sort<\/code> (<a href=\"https:\/\/play.vuetifyjs.com\/#eNqNV29vszYQ\/yonpAmyAc3\/tijp9qxbt66T1hfTpCnNC4c4CSvByDh5lEX57s\/ZGAyEir4C7n53\/vnufD4WZ+tLmvrHA7UCayboPo2JoA9vCcDs6K2JIJ4gq5h6GeVHyqUc4Ojt2ZrGQYT4zEsp91KypfM3SwleKX\/FzzcrBwc7StaUZ6jWb6VGwVGe+36WX3WdF9NkK3YIEUyQuI6IGVlHyRaV+q3UZJTwUFrlL4VcuvSOJD5IqgnZlxR\/OqS4UxqwVEQskYykx8pqD7OblmBglGY3lZDhZxbyKBWQUXFIVRCjfcq4gDNwuoELbDjbg43RtiUcIMTlBKxphh5FBnNY5IzO+QNA0gzAfuLsf5rAv2x74MJ2C21IYsYjmgUwmNyX0g0RAUwrIL5CxHBcSlLOBI2SAIwo4gy\/7UHh+6KfTSJ\/0Dg+wYqSpI3F6HZSZ9FvsrhvYWFAmkW\/i8VLJF5Iaxwmg7s6g+FVIKaGY0nhtklh2kXh1zAmEW+jMJwO6xQG17kYXVMwIE3htovCb1jzlK84nqrWZEyMyw94jE3RlDxGvhEWVdEZjeeQQohE9pCRZP01CnetkRmZOCtGZiVNqAIwReqbaH22TP9kcRylLG2Ny30jP33fCIoyNVX0cZkOu1g8HtKQvNNWEv3GSRn5ZutFoX4uGHddNH5nCT2FbL9qIzLuNw7M6Doady1Epr7ZgCYynnQx+YUlh9ZjO540cjI03jWJyaAtGle1OmxkZWna7BPm4svrM3ZZzYtkpySEDRXhDpwzyEvMVbdEcYe5kGH3\/vkEl57ZC8fmzhNI6Fd4xXYeZdThNGPxkcL8wcBA3gJ\/R3vKDsJxeg1dwSkTBK+HOThycfBg0IPvaxSuTWiyRoPc8IcOrNIiurhh\/CyOQur0qshoA06+TT+\/bit7rVFFzAs9ybUVetFf+u\/09BH0L453fQ3MpKQOV\/x8CXEc4sLqOkzGKflHXt3okSw0FZXba+CqAK4+BOocVnjO52BjlEIbfiwceMWSQfHiaVXd3aUWzst1FjC3UYIzgsyb3rFKg8qhKxNa86CrCStSgQNj74KagwLtJU9Xbf2LC5N+vxQUqvwsKGqVwtBlg6xwOnEmCpur9aSmNc2hREQiVsc5rypwBv3+FsudH\/FG6pnzTeJoK8+k2qcRy6jLMSrAox5ntJRjMSFYtoqrPlIu+ahbhu1qeNFDUFAsh\/G0W0yfCDKV9LQl9pluo0fZfGpmqh11G2JrkD2qZqr7VrfxM\/YycL4zlrK5tZstK1nLx12dNNuuacoJu8hp1VAP0Fol+IFWlGb01vq8vDaHJJTjsjLO1Z\/toXo5X83i6FQumGt0i\/ZVT+5y54sdTZzimOizIZep9pDKzsv1FL4s5nJ7ho8UFfomWVWzujxVIPBUzW7ywf\/Bcq04St4z\/7+MJfhHdX6zwgx\/IoLF8oK6\/G\/A25O0AsiFEnS+XKyLa438sT+8RfjIn\/pTy5XhWX4DhWf9gg==\">Here<\/a>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-setting-up-a-vue-component-compdatatable-vue\">Setting Up a Vue component CompDataTable.vue<\/h2>\n\n\n\n<p>First, let\u2019s create a <code>CompDataTable.vue<\/code> component that uses Vuetify\u2019s <code>v-data-table-server<\/code> to display data fetched from a fake API. You should have three files as follows:<\/p>\n\n\n\n<p>vuetify.js<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { createVuetify } from 'vuetify'\n\nexport const vuetify = createVuetify({\n  theme: {\n    defaultTheme: 'light',\n    \/\/\n  },\n})<\/code><\/pre>\n\n\n\n<p>App.vue<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template&gt;\n  &lt;CompDataTable&gt;&lt;\/CompDataTable&gt;\n&lt;\/template&gt;\n\n&lt;script setup&gt;\n  import CompDataTable from '.\/CompDataTable.vue'\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p>CompDataTable.vue<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template&gt;\n  &lt;v-data-table-server\n    v-model:items-per-page=\"itemsPerPage\"\n    :headers=\"headers\"\n    :items=\"serverItems\"\n    :items-length=\"totalItems\"\n    :loading=\"loading\"\n    :search=\"search\"\n    item-value=\"name\"\n    @update:options=\"loadItems\"\n  &gt;&lt;\/v-data-table-server&gt;\n&lt;\/template&gt;\n\n&lt;script setup&gt;\n  import { ref } from 'vue'\n\n  const desserts = &#091;\n    {\n      name: 'Frozen Yogurt',\n      calories: 159,\n      fat: 6,\n      carbs: 24,\n      protein: 4,\n      iron: '1',\n    },\n    {\n      name: 'Jelly bean',\n      calories: 375,\n      fat: 0,\n      carbs: 94,\n      protein: 0,\n      iron: '0',\n    },\n    {\n      name: 'KitKat',\n      calories: 518,\n      fat: 26,\n      carbs: 65,\n      protein: 7,\n      iron: '6',\n    },\n    {\n      name: 'Eclair',\n      calories: 262,\n      fat: 16,\n      carbs: 23,\n      protein: 6,\n      iron: '7',\n    },\n    {\n      name: 'Gingerbread',\n      calories: 356,\n      fat: 16,\n      carbs: 49,\n      protein: 3.9,\n      iron: '16',\n    },\n    {\n      name: 'Ice cream sandwich',\n      calories: 237,\n      fat: 9,\n      carbs: 37,\n      protein: 4.3,\n      iron: '1',\n    },\n    {\n      name: 'Lollipop',\n      calories: 392,\n      fat: 0.2,\n      carbs: 98,\n      protein: 0,\n      iron: '2',\n    },\n    {\n      name: 'Cupcake',\n      calories: 305,\n      fat: 3.7,\n      carbs: 67,\n      protein: 4.3,\n      iron: '8',\n    },\n    {\n      name: 'Honeycomb',\n      calories: 408,\n      fat: 3.2,\n      carbs: 87,\n      protein: 6.5,\n      iron: '45',\n    },\n    {\n      name: 'Donut',\n      calories: 452,\n      fat: 25,\n      carbs: 51,\n      protein: 4.9,\n      iron: '22',\n    },\n  ]\n  const FakeAPI = {\n    async fetch({ page, itemsPerPage, sortBy }) {\n      return new Promise(resolve =&gt; {\n        setTimeout(() =&gt; {\n          const start = (page - 1) * itemsPerPage\n          const end = start + itemsPerPage\n          const items = desserts.slice()\n          if (sortBy.length) {\n            const sortKey = sortBy&#091;0].key\n            const sortOrder = sortBy&#091;0].order\n            items.sort((a, b) =&gt; {\n              const aValue = a&#091;sortKey]\n              const bValue = b&#091;sortKey]\n              return sortOrder === 'desc' ? bValue - aValue : aValue - bValue\n            })\n          }\n          const paginated = items.slice(start, end)\n          resolve({ items: paginated, total: items.length })\n        }, 500)\n      })\n    },\n  }\n  const itemsPerPage = ref(5)\n  const headers = ref(&#091;\n    {\n      title: 'Dessert (100g serving)',\n      align: 'start',\n      sortable: false,\n      key: 'name',\n    },\n    { title: 'Calories', key: 'calories', align: 'end' },\n    { title: 'Fat (g)', key: 'fat', align: 'end' },\n    { title: 'Carbs (g)', key: 'carbs', align: 'end' },\n    { title: 'Protein (g)', key: 'protein', align: 'end' },\n    { title: 'Iron (%)', key: 'iron', align: 'end' },\n  ])\n  const search = ref('')\n  const serverItems = ref(&#091;])\n  const loading = ref(true)\n  const totalItems = ref(0)\n  function loadItems({ page, itemsPerPage, sortBy }) {\n    loading.value = true\n    FakeAPI.fetch({ page, itemsPerPage, sortBy }).then(({ items, total }) =&gt; {\n      serverItems.value = items\n      totalItems.value = total\n      loading.value = false\n    })\n  }\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p>Our application is now ready for our main goal, implement dynamic and custom slots.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-a-custom-slot\">What is a custom slot ?<\/h2>\n\n\n\n<p>In Vuejs, components can receive props, which can be JavaScript values of any type. But what about template content? Sometimes, we may need to pass a template fragment to a child component, allowing the child component to render this fragment within its own template. And that, is what a slot does.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-do-we-use-slots\">Why do we use slots ?<\/h2>\n\n\n\n<p>Slots are a powerful feature in Vue that enable the creation of more flexible and reusable components. Vue slots enable a component to accept dynamic content, referred to as slot content, and display it in a designated spot within the component&#8217;s template, which we call the slot outlet. This designated spot is marked by the HTML element &lt;slot&gt;.<\/p>\n\n\n\n<p>The element serves as a placeholder for the content provided by the parent component. This approach addresses the limitation of having a fixed template in a component. It allows users to integrate custom content into a Vue component&#8217;s layout, thereby enhancing its flexibility and reusability. In our case, let&#8217;s see how we can customize our data table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-define-dynamic-slots-in-compdatatable-vue\">Define Dynamic Slots in CompDataTable.vue<\/h2>\n\n\n\n<p>We&#8217;ll define a dynamic slot template within the <code>CompDataTable.vue<\/code> component to generate slots for each header defined in <code>dataHeaders<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template&gt;\n  &lt;v-data-table-server\n    v-model:items-per-page=\"itemsPerPage\"\n    :headers=\"headers\"\n    :items=\"serverItems\"\n    :items-length=\"totalItems\"\n    :loading=\"loading\"\n    :search=\"search\"\n    item-value=\"name\"\n    @update:options=\"loadItems\"\n  &gt;\n    &lt;template\n      v-for=\"header in headers\"\n      v-slot:&#091;`item.${header.key}`]=\"{ item }\"\n    &gt;\n      &lt;slot :name=\"`item.${header.key}`\" :value=\"item&#091;header.key]\"&gt;\n        {{ item&#091;header.key] }}\n      &lt;\/slot&gt;\n    &lt;\/template&gt;\n  &lt;\/v-data-table-server&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>Below please find explanation about different parts of the code:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Dynamic Slots:<\/code> The v-for directive iterates over each header in the headers array. For each header, a slot is created dynamically.<\/li>\n\n\n\n<li><code>Slot Name:<\/code> The <code>v-slot<\/code> directive is bound dynamically using square bracket syntax (<code>[]<\/code>) and a computed key: <code>item.${header.key}<\/code>. This creates slots dynamically for each column of the data table, allowing for customized rendering of each column&#8217;s content. This creates slots like item.name, item.calories, etc.<\/li>\n\n\n\n<li><code>Slot Props:<\/code> The { item } syntax destructures the slot props. The <code>item<\/code> variable represents the data associated with each row of the data table. When using scoped slots in Vue.js, the parent component passes scoped data to the slot content. In this context, <code>item<\/code> refers to the specific data associated with the current row being rendered in the data table. This allows for customization of each cell in the data table based on the specific data associated with that cell&#8217;s row.<br>In the context of the v-data-table-server component, Vuetify internally provides the item object representing the current row of data being rendered. When defining slots with v-slot, the content inside the slot gets access to the current item, enabling you to use its properties dynamically.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-using-custom-slots-in-app-vue\">Using Custom Slots in App.vue<\/h2>\n\n\n\n<p>Next, we\u2019ll use these dynamic slots in <code>App.vue<\/code> to customize the content for each column. For example, let&#8217;s start by changing the color of our column <code>calories<\/code>.<\/p>\n\n\n\n<p>App.vue<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template&gt;\n  &lt;CompDataTable&gt;\n    &lt;template v-slot:item.calories=\"{ value }\"&gt;\n      &lt;span style=\"color: red\"&gt;{{ value }} kcal&lt;\/span&gt;\n    &lt;\/template&gt;\n  &lt;\/CompDataTable&gt;\n&lt;\/template&gt;\n\n&lt;script setup&gt;\n  import CompDataTable from '.\/CompDataTable.vue'\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"976\" height=\"540\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-37.png\" alt=\"\" class=\"wp-image-33221\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-37.png 976w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-37-300x166.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-37-768x425.png 768w\" sizes=\"auto, (max-width: 976px) 100vw, 976px\" \/><\/figure>\n\n\n\n<p>Here&#8217;s a breakdown of what&#8217;s happening:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>v-slot:item.calories<\/code><\/strong>: This is a scoped slot directive (<code>v-slot<\/code>) that targets the slot named <code>item.calories<\/code>. In the context of a data table, <code>item<\/code> usually represents a single row of data, and <code>calories<\/code> likely refers to one of the columns in the data table.<\/li>\n\n\n\n<li><strong><code>{ value }<\/code><\/strong>: This is the destructuring syntax used to extract the value associated with the slot. In Vue.js, when passing scoped data to a slot, the parent component can provide scoped data to the slot content. Here, <code>{ value }<\/code> indicates that the parent component (in this case, <code>CompDataTable<\/code>) is passing the value associated with the <code>calories<\/code> column to the slot content. This scoped data allows the slot content to access the specific value of the <code>calories<\/code> column for each row of the data table.<\/li>\n\n\n\n<li><strong>Slot Content<\/strong>: Inside the slot content, there&#8217;s a <code>&lt;span&gt;<\/code> element styled with red color (<code>color: red<\/code>). The <code>{{ value }} kcal<\/code> part is where the scoped data is being used. <code>{{ value }}<\/code> outputs the value of the <code>calories<\/code> column for the current row, and <code>\"kcal\"<\/code> is appended to it. This customization allows for the rendering of the <code>calories<\/code> column with a specific style and formatting.<\/li>\n<\/ul>\n\n\n\n<p>We could also add a custom logo or even an action button. Even both combined, for example a trash button to delete a row from the data table. The possibilities are limitless \ud83d\ude00<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"968\" height=\"527\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-41.png\" alt=\"\" class=\"wp-image-33225\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-41.png 968w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-41-300x163.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/image-41-768x418.png 768w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>Understanding how to dynamically bind slots in Vue.js allows for powerful customization of components. Especially in scenarios like data tables where each column may require unique rendering logic. By using scoped slots and passing scoped data, we can create highly flexible and reusable components that adapt to various data structures and UI requirements. In the provided code snippet, the <code>item<\/code> variable plays a crucial role in providing the necessary data context for customizing the content of each cell in the data table.<\/p>\n\n\n\n<p>I hope this blog will be useful to you and that you now understand how to use dynamic slots in Vue.js with Vuetify data table. Also, don&#8217;t mind sharing your experiences about it \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this tutorial, we will explore how to use dynamic slots in Vue.js with Vuetify data table. Firstly, we will start with a CompDataTable.vue component and demonstrate how to define and use custom slots to dynamically customize the content of a data table. Additionally, we will explain how the dynamic slots work. I\u2019m not [&hellip;]<\/p>\n","protected":false},"author":87,"featured_media":33232,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3029],"tags":[3338,354,1601,3257,3034,3035,3358],"type_dbi":[3363,3360,3362,3361,3039,3038,3359],"class_list":["post-33171","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web","tag-html","tag-html-5","tag-replication-slots","tag-typescript","tag-vue","tag-vuejs","tag-vuetify","type-dynamic","type-html","type-slots","type-typescript","type-vue","type-vuejs","type-vuetify"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use Dynamic Slots in Vue.js with Vuetify Data Table - dbi Blog<\/title>\n<meta name=\"description\" content=\"Explore the power of dynamic slots in Vue.js with Vuetify data tables. Learn how to customize content dynamically, enhance flexibility, and create reusable components for your Vue.js applications.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Dynamic Slots in Vue.js with Vuetify Data Table\" \/>\n<meta property=\"og:description\" content=\"Explore the power of dynamic slots in Vue.js with Vuetify data tables. Learn how to customize content dynamically, enhance flexibility, and create reusable components for your Vue.js applications.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-24T08:38:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-24T08:38:47+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"180\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joan Frey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joan Frey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/\"},\"author\":{\"name\":\"Joan Frey\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06\"},\"headline\":\"How to Use Dynamic Slots in Vue.js with Vuetify Data Table\",\"datePublished\":\"2024-05-24T08:38:44+00:00\",\"dateModified\":\"2024-05-24T08:38:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/\"},\"wordCount\":929,\"commentCount\":4,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png\",\"keywords\":[\"HTML\",\"HTML 5\",\"replication slots\",\"TypeScript\",\"vue\",\"vuejs\",\"vuetify\"],\"articleSection\":[\"Web\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/\",\"name\":\"How to Use Dynamic Slots in Vue.js with Vuetify Data Table - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png\",\"datePublished\":\"2024-05-24T08:38:44+00:00\",\"dateModified\":\"2024-05-24T08:38:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06\"},\"description\":\"Explore the power of dynamic slots in Vue.js with Vuetify data tables. Learn how to customize content dynamically, enhance flexibility, and create reusable components for your Vue.js applications.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png\",\"width\":300,\"height\":180,\"caption\":\"Logo-Vuejs\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Dynamic Slots in Vue.js with Vuetify Data Table\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06\",\"name\":\"Joan Frey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g\",\"caption\":\"Joan Frey\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/joanfrey\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use Dynamic Slots in Vue.js with Vuetify Data Table - dbi Blog","description":"Explore the power of dynamic slots in Vue.js with Vuetify data tables. Learn how to customize content dynamically, enhance flexibility, and create reusable components for your Vue.js applications.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Dynamic Slots in Vue.js with Vuetify Data Table","og_description":"Explore the power of dynamic slots in Vue.js with Vuetify data tables. Learn how to customize content dynamically, enhance flexibility, and create reusable components for your Vue.js applications.","og_url":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/","og_site_name":"dbi Blog","article_published_time":"2024-05-24T08:38:44+00:00","article_modified_time":"2024-05-24T08:38:47+00:00","og_image":[{"width":300,"height":180,"url":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png","type":"image\/png"}],"author":"Joan Frey","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Joan Frey","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/"},"author":{"name":"Joan Frey","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06"},"headline":"How to Use Dynamic Slots in Vue.js with Vuetify Data Table","datePublished":"2024-05-24T08:38:44+00:00","dateModified":"2024-05-24T08:38:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/"},"wordCount":929,"commentCount":4,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png","keywords":["HTML","HTML 5","replication slots","TypeScript","vue","vuejs","vuetify"],"articleSection":["Web"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/","url":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/","name":"How to Use Dynamic Slots in Vue.js with Vuetify Data Table - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png","datePublished":"2024-05-24T08:38:44+00:00","dateModified":"2024-05-24T08:38:47+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06"},"description":"Explore the power of dynamic slots in Vue.js with Vuetify data tables. Learn how to customize content dynamically, enhance flexibility, and create reusable components for your Vue.js applications.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/05\/Logo-Vuejs-e1716299720267.png","width":300,"height":180,"caption":"Logo-Vuejs"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/how-to-use-dynamic-slots-in-vue-js-with-vuetify-data-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Dynamic Slots in Vue.js with Vuetify Data Table"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c03c47649664fe73b27ce457e99f5b06","name":"Joan Frey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1e650cf665b4d44dd186355827c0b049d2f95c8cbb45fd10d4e7cb255be67ecb?s=96&d=mm&r=g","caption":"Joan Frey"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/joanfrey\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=33171"}],"version-history":[{"count":31,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33171\/revisions"}],"predecessor-version":[{"id":33271,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33171\/revisions\/33271"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/33232"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=33171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=33171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=33171"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=33171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}