Skip to content

Commit 3285518

Browse files
committed
fix(QTh): "click" event not working when not using "props" #12845
1 parent 04d3543 commit 3285518

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ui/src/components/table/QTh.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ export default createComponent({
1919
const vm = getCurrentInstance()
2020
const { proxy: { $q } } = vm
2121

22+
const onClick = evt => { emit('click', evt) }
23+
2224
return () => {
2325
if (props.props === void 0) {
2426
return h('th', {
25-
class: props.autoWidth === true ? 'q-table--col-auto-width' : ''
27+
class: props.autoWidth === true ? 'q-table--col-auto-width' : '',
28+
onClick
2629
}, hSlot(slots.default))
2730
}
2831

@@ -60,7 +63,7 @@ export default createComponent({
6063
style: col.headerStyle,
6164
onClick: evt => {
6265
col.sortable === true && props.props.sort(col) // eslint-disable-line
63-
emit('click', evt)
66+
onClick(evt)
6467
}
6568
}
6669

0 commit comments

Comments
 (0)