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][3.6.11] VExpansionPanels value prop not working #20109

Closed
Icebreaker83 opened this issue Jul 5, 2024 · 6 comments · Fixed by Enterprise-CMCS/cmcs-eregulations#1413 · May be fixed by Equoa1/Thiio-Laravel-Vue#1 or jonathanestefani/crud_vuetify#5
Assignees

Comments

@Icebreaker83
Copy link

Environment

Vuetify Version: 3.6.11
Vue Version: 3.4.31
Browsers: Chrome 126.0.0.0
OS: Windows 10

Steps to reproduce

  1. Add value prop to v-expansion-panels or v-expansion-panel
  2. Give the value prop an array of indexes of panels that need to be opened by default

Expected Behavior

Panels with indexes that are in value prop should be opened by default

Actual Behavior

Panels are not open by default.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

I've tried with :value="[0]" , :value="0", on v-expansion-panels and on v-expansion-panel.
Currently only way of getting the expansion panel open by default is through v-model.

@KaelWD
Copy link
Member

KaelWD commented Jul 5, 2024

v-model is model-value not value

@KaelWD KaelWD closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
@Icebreaker83
Copy link
Author

@KaelWD I think you misunderstood. This ticket is not about v-model, its about value prop

@nguyentranchung
Copy link

@Icebreaker83

Panels are not open by default, because you don't set a value for v-expansion-panel

<template>
  <v-app>
    <v-container>
      <v-expansion-panels :model-value="[0]">
        <v-expansion-panel :value="0"> <-- this is point
          <template #title>
            <h4>Some title</h4>
          </template>
          <template #text>
            <h4>Content</h4>
          </template>
        </v-expansion-panel>
      </v-expansion-panels>
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const expand = ref([0])
</script>

https://play.vuetifyjs.com/#eNqNUcuOwjAM/BUre2BX2m457KkqSKv9BI6UQ1SMiJSXErdCQvw7bkqBiB64JLFnPLHH27OIoS3/vP/pOxSVqAmN15Jw3ViAui+k9+mZgtZZkspiuKVSEk9e2qicLfhGHaEybo+66KXucNWI7XLXiHvBXAlUE3eZMZk7tQMfpEiPXT3Bx9/1xhmEBNYlh1l1mU0zJ4onmtH85znR0nuCdfky0MOeVyxOdjKU+zlkRruzfziMbVCeICJ14zaU8S4QnCHgAS5wCM7Agje4GOgArBsJ0sd7WA2kT97C1yA8SrGIuHzbTut07K6HX6FC

@Icebreaker83
Copy link
Author

@nguyentranchung Makes sense. Thanks!

@nguyentranchung
Copy link

This issue can be closed

@KaelWD KaelWD closed this as completed in 719a64a Jul 8, 2024
@KaelWD KaelWD self-assigned this Jul 8, 2024
@KaelWD
Copy link
Member

KaelWD commented Jul 8, 2024

The default value is the index, the problem here was just using value instead of model-value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment