@@ -33,7 +33,8 @@ export default create({
data() {
return {
- show: null
+ show: null,
+ inited: null
};
},
@@ -66,6 +67,7 @@ export default create({
this.findParent('van-collapse');
this.items.push(this);
this.show = this.expanded;
+ this.inited = this.expanded;
},
destroyed() {
@@ -80,6 +82,7 @@ export default create({
if (expanded) {
this.show = true;
+ this.inited = true;
}
this.$nextTick(() => {
diff --git a/packages/collapse/test/__snapshots__/demo.spec.js.snap b/packages/collapse/test/__snapshots__/demo.spec.js.snap
index 72d5ff2ce..68d2d4a97 100644
--- a/packages/collapse/test/__snapshots__/demo.spec.js.snap
+++ b/packages/collapse/test/__snapshots__/demo.spec.js.snap
@@ -26,9 +26,7 @@ exports[`renders demo correctly 1`] = `