diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js new file mode 100644 index 000000000..daca84eef --- /dev/null +++ b/src/boot/qformMixin.js @@ -0,0 +1,20 @@ +import { QTable, QForm } from 'quasar'; + +export default { + inject: { QForm }, + component: { QForm }, + components: { QForm }, + extends: { QForm }, + mounted: function () { + if (this.$el?.classList?.contains('q-form')) + if (this.$el?.id !== 'searchbarForm') { + let that = this; + + document.addEventListener('keyup', function (evt) { + if (evt.keyCode === 13) { + that.onSubmit(); + } + }); + } + }, +}; diff --git a/src/boot/quasar.js b/src/boot/quasar.js new file mode 100644 index 000000000..a8d9b7ad9 --- /dev/null +++ b/src/boot/quasar.js @@ -0,0 +1,6 @@ +import { boot } from 'quasar/wrappers'; +import qFormMixin from './qformMixin'; + +export default boot(({ app }) => { + app.mixin(qFormMixin); +});