fixed the bug about v-modle
This commit is contained in:
parent
2ec8433350
commit
ad74efbc83
1 changed files with 9 additions and 5 deletions
|
@ -115,8 +115,8 @@
|
|||
methods: {
|
||||
toggleCollapse () {
|
||||
this.isCollapsed = this.collapsible ? !this.isCollapsed : false;
|
||||
this.$emit('input', !this.isCollapsed);
|
||||
this.$emit('on-collapse', !this.isCollapsed);
|
||||
this.$emit('input', this.isCollapsed);
|
||||
this.$emit('on-collapse', this.isCollapsed);
|
||||
},
|
||||
matchMedia () {
|
||||
let matchMedia;
|
||||
|
@ -137,12 +137,16 @@
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
on(window, 'resize', this.onWindowResize);
|
||||
this.matchMedia();
|
||||
this.$emit('input', this.defaultCollapsed);
|
||||
if (this.defaultCollapsed) {
|
||||
this.isCollapsed = true;
|
||||
this.$emit('input', this.defaultCollapsed);
|
||||
} else {
|
||||
if (this.value !== undefined) {
|
||||
this.isCollapsed = this.value;
|
||||
}
|
||||
}
|
||||
on(window, 'resize', this.onWindowResize);
|
||||
this.matchMedia();
|
||||
},
|
||||
destroyed () {
|
||||
off(window, 'resize', this.onWindowResize);
|
||||
|
|
Loading…
Add table
Reference in a new issue