App.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!--
  2. - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
  3. -
  4. - Licensed under the GNU Affero General Public License, Version 3 (the "License");
  5. - you may not use this file except in compliance with the License.
  6. - You may obtain a copy of the License at
  7. -
  8. - https://www.gnu.org/licenses/agpl-3.0.html
  9. -
  10. - Unless required by applicable law or agreed to in writing, software
  11. - distributed under the License is distributed on an "AS IS" BASIS,
  12. - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. - See the License for the specific language governing permissions and
  14. - limitations under the License.
  15. -->
  16. <script lang="ts" setup>
  17. import { NaiveProvider } from '@/components/common';
  18. import { useTheme } from '@/hooks/useTheme';
  19. import { useLanguage } from '@/hooks/useLanguage';
  20. import { NWatermark } from 'naive-ui';
  21. const { theme, themeOverrides } = useTheme();
  22. const { language } = useLanguage();
  23. const waterMark = import.meta.env.VITE_WATER_MARK;
  24. </script>
  25. <template>
  26. <n-config-provider
  27. :locale="language"
  28. :theme="theme"
  29. :theme-overrides="themeOverrides"
  30. class="h-full w-full"
  31. >
  32. <NaiveProvider>
  33. <RouterView />
  34. </NaiveProvider>
  35. </n-config-provider>
  36. <NWatermark
  37. v-if="waterMark !== ''"
  38. :content="waterMark"
  39. :font-size="14"
  40. :height="384"
  41. :line-height="10"
  42. :rotate="-20"
  43. :width="284"
  44. :x-offset="22"
  45. :y-offset="100"
  46. :z-index="9999"
  47. cross
  48. fullscreen
  49. />
  50. </template>