-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.vue
47 lines (38 loc) · 1.2 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
<div class="h-full dark:bg-[#101014] min-h-screen">
<NConfigProvider :theme="isDark ? darkTheme : null">
<FormProvider :darkMode="isDark">
<div class="bg-gray-200 dark:(bg-[#18181C] text-white) flex items-center justify-between w-full h-16 p-4">
<div class="text-lg font-medium">
SweetForms Sandbox
</div>
<div>
<n-switch v-model:value="isDark">
<template #checked>
<i-mdi-white-balance-sunny/>
</template>
<template #unchecked>
<i-mdi-moon-waning-crescent/>
</template>
</n-switch>
</div>
</div>
<div class="p-6">
<DemoRenderer />
</div>
</FormProvider>
</NConfigProvider>
</div>
</template>
<script setup lang="ts">
import { useTheme } from "./useTheme"
import { NConfigProvider, darkTheme, NInput, NCard, NButton, NSwitch } from "naive-ui"
import { FormProvider, useSweetform, SweetformTypes } from './index';
import DemoRenderer from "./DemoRenderer.vue"
const { isDark, toggle, themeName } = useTheme()
</script>
<style>
body {
@apply v-bind(themeName);
}
</style>