Vuetify: [Bug Report] simple-table v-for broken

Created on 9 May 2019  路  5Comments  路  Source: vuetifyjs/vuetify

Versions and Environment

Vuetify: 2.0.0-alpha.19
Vue: 2.6.10
Browsers: Chrome 73.0.3683.103
OS: Windows 10

Steps to reproduce

Create a simple-table

Expected Behavior

Loop through an array to create a simple-table

Actual Behavior

simple-table breaks on v-for, wanting the variable to be defined in the app

Reproduction Link

https://codepen.io/fishchar/pen/gJPvEW

Other comments

Error: Property or method "item" is not defined on the instance but referenced during render.
Issue: Cannot loop through items in the simple-table component.
Example (using Doc's codepen example): https://codepen.io/fishchar/pen/gJPvEW

triage

Most helpful comment

Hm. This also seems to be a Vue bug? If you wrap the content in <template v-slot:default> it works in the codepen.

All 5 comments

Should I use alpha in production?
No.

Should I report bugs that I find in the alpha?
No. We will open up bug reporting once we move to beta.

What should I do now?
Just close this issue. If this bug persists after the beta release, then resubmit it.

Wasn't sure if it should be reported or not. Take a deep breath.

Hm. This also seems to be a Vue bug? If you wrap the content in <template v-slot:default> it works in the codepen.

Interesting find. So is there a safe place to report alpha bugs or does it not really matter? I was just messing around checking Vuetify out.

I am using the CDN version and v-simple-table renders a string inside a table when you inspect it in devtools.

image

Using @nekosaur 's fix did it.

Wrap the contents of v-simple-table inside a <template v-slot:default>.

<v-simple-table>
  <template v-slot:default>
    <thead>
      <tr>
        <th class="text-left">Name</th>
        <th class="text-left">Calories</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="item in desserts" :key="item.name">
        <td>{{ item.name }}</td>
        <td>{{ item.calories }}</td>
      </tr>
    </tbody>
  </template>
</v-simple-table>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

gluons picture gluons  路  3Comments

milleraa picture milleraa  路  3Comments

alterhu2020 picture alterhu2020  路  3Comments

jofftiquez picture jofftiquez  路  3Comments

ricardovanlaarhoven picture ricardovanlaarhoven  路  3Comments