refactor: #6993 set default QTable pagination, created quasar.defaults for standards
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2024-03-14 13:06:02 +01:00
parent 37a2c33f9f
commit a968540635
4 changed files with 9 additions and 7 deletions

View File

@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files
boot: ['i18n', 'axios', 'vnDate', 'validations', 'setDefaults'],
boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar.defaults'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss'],

View File

@ -0,0 +1,5 @@
import { QTable } from 'quasar';
import setDefault from './setDefault';
setDefault(QTable, 'pagination', { rowsPerPage: 25 });
setDefault(QTable, 'hidePagination', true);

View File

@ -1,6 +1,4 @@
import { QTable } from 'quasar';
const setDefault = (component, key, value) => {
export default function (component, key, value) {
const prop = component.props[key];
switch (typeof prop) {
case 'object':
@ -17,6 +15,4 @@ const setDefault = (component, key, value) => {
default:
throw new Error('unhandled type: ' + typeof prop);
}
};
setDefault(QTable, 'pagination', { rowsPerPage: 25 });
setDefault(QTable, 'hidePagination', true);
}

View File

@ -0,0 +1 @@
export * from './defaults/qTable';