Skip to content

Commit bd47467

Browse files
committed
fixes for model mixin
1 parent a2ea143 commit bd47467

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

src/components/collapsible/QCollapsible.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@ export default {
105105
}
106106
},
107107
methods: {
108-
__show () {
109-
this.showPromise && this.showPromiseResolve()
110-
},
111-
__hide () {
112-
this.hidePromise && this.hidePromiseResolve()
113-
},
114108
__toggleItem () {
115109
if (!this.iconToggle) {
116110
this.toggle()

src/components/fab/QFab.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@ export default {
5454
__qFabClose: this.hide
5555
}
5656
},
57-
methods: {
58-
__show () {
59-
this.showPromise && this.showPromiseResolve()
60-
},
61-
__hide () {
62-
this.hidePromise && this.hidePromiseResolve()
57+
mounted () {
58+
if (this.value) {
59+
this.show()
6360
}
6461
}
6562
}

src/components/fab/QFabAction.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ export default {
4343
this.$emit('click', e)
4444
})
4545
}
46-
},
47-
mounted () {
48-
if (this.value) {
49-
this.show()
50-
}
5146
}
5247
}
5348
</script>

src/mixins/model-toggle.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,16 @@ export default {
7676
reject(new Error())
7777
}
7878
})
79-
this.__show(evt)
79+
80+
this.$nextTick(() => {
81+
if (this.__show) {
82+
this.__show(evt)
83+
}
84+
else {
85+
this.showPromiseResolve()
86+
}
87+
})
88+
8089
return this.showPromise
8190
},
8291
hide (evt) {
@@ -98,7 +107,14 @@ export default {
98107
reject(new Error())
99108
}
100109
})
101-
this.__hide(evt)
110+
this.$nextTick(() => {
111+
if (this.__hide) {
112+
this.__hide(evt)
113+
}
114+
else {
115+
this.hidePromiseResolve()
116+
}
117+
})
102118
return this.hidePromise
103119
}
104120
},
@@ -108,7 +124,7 @@ export default {
108124
this.showPromise && this.showPromiseReject()
109125
this.hidePromise && this.hidePromiseReject()
110126
this.$emit('input', false)
111-
this.__hide()
127+
this.__hide && this.__hide()
112128
}
113129
}
114130
}

0 commit comments

Comments
 (0)