mirror of
https://github.com/gotson/komga.git
synced 2026-05-09 05:10:19 +02:00
add vuetify rules lab
This commit is contained in:
parent
4ef42996c0
commit
3ce26e7198
2 changed files with 14 additions and 4 deletions
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
// Plugins
|
||||
import vuetify from './vuetify'
|
||||
import {vuetify, vuetifyRulesPlugin} from './vuetify'
|
||||
import pinia from '../stores'
|
||||
import router from '../router'
|
||||
import {PiniaColada} from '@pinia/colada'
|
||||
|
|
@ -13,7 +13,6 @@ import { PiniaColadaAutoRefetch } from '@pinia/colada-plugin-auto-refetch'
|
|||
|
||||
// Types
|
||||
import type {App} from 'vue'
|
||||
|
||||
// Navigation guards
|
||||
import {useLoginGuard} from '@/router/login-guard'
|
||||
import {useRoleGuard} from '@/router/role-guard.ts'
|
||||
|
|
@ -21,6 +20,7 @@ import {useRoleGuard} from '@/router/role-guard.ts'
|
|||
export function registerPlugins(app: App) {
|
||||
app
|
||||
.use(vuetify)
|
||||
.use(vuetifyRulesPlugin)
|
||||
// .use(DataLoaderPlugin, {router})
|
||||
.use(router)
|
||||
.use(pinia)
|
||||
|
|
|
|||
|
|
@ -11,11 +11,13 @@ import 'vuetify/styles'
|
|||
// Composables
|
||||
import {createVuetify} from 'vuetify'
|
||||
import {md3} from 'vuetify/blueprints'
|
||||
import {VIconBtn} from 'vuetify/labs/components'
|
||||
|
||||
// Labs
|
||||
import {VIconBtn} from 'vuetify/labs/components'
|
||||
import {createRulesPlugin} from 'vuetify/labs/rules'
|
||||
|
||||
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
||||
export default createVuetify({
|
||||
export const vuetify = createVuetify({
|
||||
theme: {
|
||||
defaultTheme: 'light',
|
||||
themes: {
|
||||
|
|
@ -42,3 +44,11 @@ export default createVuetify({
|
|||
VIconBtn,
|
||||
},
|
||||
})
|
||||
|
||||
export const vuetifyRulesPlugin = createRulesPlugin({
|
||||
aliases: {
|
||||
sameAs: (other?: string, err?: string) => {
|
||||
return (v: unknown) => other === v || err || 'Field must be same'
|
||||
},
|
||||
},
|
||||
}, vuetify.locale)
|
||||
|
|
|
|||
Loading…
Reference in a new issue