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: {
|
methods: {
|
||||||
toggleCollapse () {
|
toggleCollapse () {
|
||||||
this.isCollapsed = this.collapsible ? !this.isCollapsed : false;
|
this.isCollapsed = this.collapsible ? !this.isCollapsed : false;
|
||||||
this.$emit('input', !this.isCollapsed);
|
this.$emit('input', this.isCollapsed);
|
||||||
this.$emit('on-collapse', !this.isCollapsed);
|
this.$emit('on-collapse', this.isCollapsed);
|
||||||
},
|
},
|
||||||
matchMedia () {
|
matchMedia () {
|
||||||
let matchMedia;
|
let matchMedia;
|
||||||
|
@ -137,12 +137,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
on(window, 'resize', this.onWindowResize);
|
|
||||||
this.matchMedia();
|
|
||||||
this.$emit('input', this.defaultCollapsed);
|
|
||||||
if (this.defaultCollapsed) {
|
if (this.defaultCollapsed) {
|
||||||
this.isCollapsed = true;
|
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 () {
|
destroyed () {
|
||||||
off(window, 'resize', this.onWindowResize);
|
off(window, 'resize', this.onWindowResize);
|
||||||
|
|
Loading…
Add table
Reference in a new issue