Vuetify: 1.1.1
Last working version: 1.0.19
Vue: 2.5.16
Browsers: Google Chrome
OS: Mac OSX
See Codepen link (official example).
The panel property in the Codepen example is initialised as panel: [false, true, true]. I would expect the v-expansion-panel-content components number 1 and 2 (zero-based) to be open upon initialisation.
The v-expansion-panel-content components number 1 and 2 (zero-based) are not open upon initialisation, but closed and then opened with an animation.
https://codepen.io/anon/pen/PaggyY?&editors=101
This used to work in version 1.0.19 with the value property set on each separate v-expansion-panel-content component.
Can be fixed with a simple modification to register (), but updateFromValue () will need to be rewritten to avoid loads of extra iteration.
diff --git a/src/components/VExpansionPanel/VExpansionPanel.js b/src/components/VExpansionPanel/VExpansionPanel.js
index 1de866d..4cd3157 100644
--- a/src/components/VExpansionPanel/VExpansionPanel.js
+++ b/src/components/VExpansionPanel/VExpansionPanel.js
@@ -106,9 +106,10 @@ export default {
this.updatePanels(open)
if (this.expand) this.$emit('input', open)
},
- register (uid, toggle) {
- this.items.push({ uid, toggle })
- this.open.push(false)
+ register (uid, toggle, vm) {
+ const i = this.items.push({ uid, toggle }) - 1
+ this.value !== null && this.updateFromValue(this.value)
+ vm.isActive = this.open[i]
},
unregister (uid) {
const index = this.items.findIndex(i => i.uid === uid)
diff --git a/src/components/VExpansionPanel/VExpansionPanelContent.js b/src/components/VExpansionPanel/VExpansionPanelContent.js
index ff6965f..0eda534 100644
--- a/src/components/VExpansionPanel/VExpansionPanelContent.js
+++ b/src/components/VExpansionPanel/VExpansionPanelContent.js
@@ -50,8 +50,8 @@ export default {
}
},
- mounted () {
- this.expansionPanel.register(this._uid, this.toggle)
+ beforeMount () {
+ this.expansionPanel.register(this._uid, this.toggle, this)
// Can be removed once fully deprecated
if (typeof this.value !== 'undefined') consoleWarn('v-model has been deprecated', this)
This should be backported
Most helpful comment
This should be backported