refactor: #6993 set default QTable pagination, created quasar.defaults for standards
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
37a2c33f9f
commit
a968540635
|
@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) {
|
||||||
// app boot file (/src/boot)
|
// app boot file (/src/boot)
|
||||||
// --> boot files are part of "main.js"
|
// --> boot files are part of "main.js"
|
||||||
// https://v2.quasar.dev/quasar-cli/boot-files
|
// 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
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
||||||
css: ['app.scss'],
|
css: ['app.scss'],
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { QTable } from 'quasar';
|
||||||
|
import setDefault from './setDefault';
|
||||||
|
|
||||||
|
setDefault(QTable, 'pagination', { rowsPerPage: 25 });
|
||||||
|
setDefault(QTable, 'hidePagination', true);
|
|
@ -1,6 +1,4 @@
|
||||||
import { QTable } from 'quasar';
|
export default function (component, key, value) {
|
||||||
|
|
||||||
const setDefault = (component, key, value) => {
|
|
||||||
const prop = component.props[key];
|
const prop = component.props[key];
|
||||||
switch (typeof prop) {
|
switch (typeof prop) {
|
||||||
case 'object':
|
case 'object':
|
||||||
|
@ -17,6 +15,4 @@ const setDefault = (component, key, value) => {
|
||||||
default:
|
default:
|
||||||
throw new Error('unhandled type: ' + typeof prop);
|
throw new Error('unhandled type: ' + typeof prop);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
setDefault(QTable, 'pagination', { rowsPerPage: 25 });
|
|
||||||
setDefault(QTable, 'hidePagination', true);
|
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './defaults/qTable';
|
Loading…
Reference in New Issue