Skip to content

Commit 3e76fa6

Browse files
committed
fix(QBtnToggle): attach listeners directly to each inner QBtn quasarframework#7150
1 parent 50af438 commit 3e76fa6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

ui/dev/src/pages/web-tests/fast-test.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
For some test that you think it should be persistent,
99
make a new *.vue file here or in another folder under /dev/components.
1010
-->
11+
<q-btn-toggle value="off" :options="options" @click="notify" @mouseover="notify" class="q-ma-md" />
1112
</div>
1213
</template>
1314

@@ -17,9 +18,13 @@
1718
export default {
1819
data () {
1920
return {
21+
options: [{label:'Popup', value: 'on'}, {label:'No popup', value: 'off'}]
2022
}
2123
},
2224
methods: {
25+
notify: function () {
26+
this.$q.notify('Running on Quasar v' + this.$q.version)
27+
}
2328
}
2429
}
2530
</script>

ui/src/components/btn-toggle/QBtnToggle.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ export default Vue.extend({
9595
const child = this.options.map((opt, i) => {
9696
return h(QBtn, {
9797
key: i,
98-
on: { click: e => this.__set(opt.value, opt, e) },
98+
on: {
99+
...this.qListeners,
100+
click: e => this.__set(opt.value, opt, e)
101+
},
99102
props: {
100103
disable: this.disable || opt.disable,
101104
label: opt.label,
@@ -136,8 +139,7 @@ export default Vue.extend({
136139
unelevated: this.unelevated,
137140
glossy: this.glossy,
138141
spread: this.spread
139-
},
140-
on: { ...this.qListeners }
142+
}
141143
}, child)
142144
}
143145
})

0 commit comments

Comments
 (0)