question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Docs] DataTable: missing props for item scoped slot

See original GitHub issue

Problem to solve

This is about the beta v2.0.0-beta.1.

At the moment, it is not possible to let a table row become a clickable route and have select boxes at the same time because there is no way to native way to get the checked status of a specific row.

My old setup was like this:

<template
    slot="items"
    slot-scope="props">
        <tr
	:active="props.selected"
	class="pointer"
	@click="to('/somewhere')">
	    <td>
	        <v-checkbox
	        :input-value="props.selected"
	        primary
	        hide-details
	        @click.stop="props.selected = !props.selected"/>
	    </td>
	    <td>{{ props.item.name }}</td>
	    <td>{{ props.item.description }}</td>
	</tr>
</template>

Proposed solution

Add the props from header.data-table-select to the body prop so one can simulate a route via row clicks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nekosaurcommented, Jun 5, 2019

oh, right. you’re using the click handler. so you’d do @click.stop="select.on.input(!select.props.value)", alternatively @change="select.on.input"

https://codepen.io/anon/pen/rggNKz?editors=1010

yeah, documentation for slot props is probably not 100% yet. it’s something we unfortunately can’t autogenerate yet.

0reactions
josephgunawan97commented, Feb 25, 2020

Hello,

Have been trying to use this solution for vuetify 2.2.14 but came up with ‘value’ undefined

https://codepen.io/josephgunawan/pen/KKpajYe

Did i do something wrong? Need some solution. Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding scoped slots in Vue.js - Binarcode
To put it simply a slot can be seen as a: A placeholder for content. An empty space that you want to fill...
Read more >
Accessing number prop value for table colspan inside Vuetify ...
According to the props docs page, you have to use v-bind to tell Vue that this is a JS ... so I know...
Read more >
Data Table - Quasar Framework
Data Table. QTable is a Component that allows you to display data in a tabular manner. Features: Filtering; Sorting; Single / Multiple rows ......
Read more >
<thead>: The Table Head element - HTML - MDN Web Docs
The HTML element defines a set of rows defining the head of the columns of the table.
Read more >
Slots - Vue.js
It replaces the slot and slot-scope attributes, which are now deprecated, but have not been ... Attributes bound to a <slot> element are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found