HC200ok / vue3-easy-data-table

A customizable and easy-to-use data table component made with Vue.js 3.x
MIT License
536 stars 105 forks source link

How to access item slot for variable column names #352

Open thepurpleblob opened 8 months ago

thepurpleblob commented 8 months ago

If that makes sense...

My column headers change according to the data, dynamically.

However, I'd like to target certain columns where I don't know the name of the slot at coding time. So, I want to do

<template #item-

Is this possible?

thepurpleblob commented 8 months ago

Almost immediately answering my own question by reading the docs

<template v-slot=[slotname]>

Elsewhere...

const slotname = 'item-' + some_variable_name;

(Dynamic arguments which was new to me)