We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8a59f7 commit 573c872Copy full SHA for 573c872
src/useThemeCheck.js
@@ -0,0 +1,28 @@
1
+import { computed } from "vue";
2
+
3
+export function useThemeCheck() {
4
+ const isThemeValid = computed(() => {
5
+ return (config) => {
6
+ if (!config || !config.theme) return false;
7
+ return [
8
+ 'default',
9
+ 'dark',
10
+ 'celebration',
11
+ 'celebrationNight',
12
+ 'hack',
13
+ 'zen',
14
+ 'concrete'
15
+ ].includes(config.theme)
16
+ }
17
+ });
18
19
+ function warnInvalidTheme(config) {
20
+ if (!config?.debug) return;
21
+ console.warn(`Vue Data UI - "${config?.theme}" is not a valid theme.\n\nAvailable themes:\n\n- default (or "")\n- dark\n- celebration\n- celebrationNight \n- hack\n- zen\n- concrete`);
22
23
24
+ return {
25
+ isThemeValid,
26
+ warnInvalidTheme
27
28
+}
0 commit comments