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)
|
||||
// --> 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'],
|
||||
|
|
|
@ -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';
|
||||
|
||||
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);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export * from './defaults/qTable';
|
Loading…
Reference in New Issue