Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] VDataTable expand slot doesn't work with normal element #4948

Closed
lzhoucs opened this issue Aug 24, 2018 · 1 comment
Closed
Assignees
Labels
T: bug Functionality that does not work as intended/expected
Milestone

Comments

@lzhoucs
Copy link

lzhoucs commented Aug 24, 2018

expand slot can't be used on normal elements.

Versions and Environment

Vuetify: https://unpkg.com/vuetify@1.1.14/dist/vuetify.min.js
Vue: https://unpkg.com/vue@2.5.17/dist/vue.js
Browsers: Version 68.0.3440.106 (Official Build) (64-bit)
OS: macos 10.13

Steps to reproduce

Expected Behavior

The 2nd table rows expand should work, as vue supports slots on normal elements: https://vuejs.org/v2/guide/components-slots.html

Actual Behavior

The 2nd table rows are not expandable

Reproduction Link

Go to https://codepen.io/lzhoucs/pen/mGeBqz

Additional Comments:

On the other hand, items slots work with normal elements in real projects, but not on codepen. For example, with the link above, the table brearks as soon as items slot is changed to the following to remove template:

        <tr slot="items" slot-scope="props" @click="props.expanded = !props.expanded">
          <td>{{ props.item.name }}</td>
          <td>{{ props.item.calories }}</td>
        </tr>

but it works in real projects with the same vue/vuetify version. Not sure if it is related to the expand slot issue.

@KaelWD KaelWD added the T: bug Functionality that does not work as intended/expected label Aug 24, 2018
@KaelWD
Copy link
Member

KaelWD commented Aug 24, 2018

This is why typescript is good, that needs to be an array. First is template, second is bare span:
image

Edit: turns out TS wouldn't have caught this, thanks Vue: vuejs/vue#8644

@KaelWD KaelWD self-assigned this Aug 24, 2018
@KaelWD KaelWD added this to the v1.1.x milestone Aug 24, 2018
@KaelWD KaelWD closed this as completed in 0398263 Aug 28, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

2 participants