Skip to content

Commit 890d08d

Browse files
committed
fix card expand negative margin
1 parent 58564e4 commit 890d08d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/components/mdCard/mdCardExpand.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@
1818
}
1919
},
2020
mounted() {
21-
this.trigger = this.$el.querySelector('[md-expand-trigger]');
22-
this.content = this.$el.querySelector('.md-card-content');
21+
window.setTimeout(() => {
22+
this.trigger = this.$el.querySelector('[md-expand-trigger]');
23+
this.content = this.$el.querySelector('.md-card-content');
2324
24-
if (this.content) {
25-
this.setContentMargin();
25+
if (this.content) {
26+
this.setContentMargin();
2627
27-
this.trigger.addEventListener('click', this.toggle);
28-
window.addEventListener('resize', this.onWindowResize);
29-
}
28+
this.trigger.addEventListener('click', this.toggle);
29+
window.addEventListener('resize', this.onWindowResize);
30+
}
31+
}, 200);
3032
},
3133
destroyed() {
3234
if (this.content) {

0 commit comments

Comments
 (0)