theme.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view :class="`theme_${theme}`">
  3. <slot></slot>
  4. <GlobalLoading />
  5. </view>
  6. </template>
  7. <script setup>
  8. import { computed } from "vue";
  9. import { useUserStore } from "@/store";
  10. import GlobalLoading from "./GlobalLoading.vue";
  11. const useUser = useUserStore();
  12. const theme = computed(() => useUser.getTheme);
  13. </script>
  14. <style lang="less">
  15. @import "@/static/css/theme.less";
  16. :deep(.cu-custom) {
  17. .cu-bar {
  18. background-color: var(--nav-background) !important;
  19. color: var(--theme) !important;
  20. .action {
  21. .cuIcon-back {
  22. color: var(--black) !important;
  23. }
  24. }
  25. .right {
  26. color: var(--black) !important;
  27. }
  28. }
  29. }
  30. .uni-picker-custom {
  31. .uni-picker-header {
  32. background-color: var(--dark);
  33. }
  34. }
  35. :deep(.uni-popup) {
  36. .uni-popup-dialog {
  37. background-color: var(--bg) !important;
  38. .uni-dialog-title {
  39. .uni-popup__info {
  40. color: var(--black);
  41. }
  42. }
  43. .uni-dialog-content {
  44. color: var(--theme);
  45. .uni-dialog-input {
  46. border-color: var(--border);
  47. background-color: var(--dark);
  48. color: var(--theme);
  49. }
  50. }
  51. .uni-dialog-button {
  52. .uni-dialog-button-text {
  53. color: var(--gray);
  54. }
  55. }
  56. .uni-dialog-button:last-child {
  57. .uni-dialog-button-text {
  58. color: var(--theme);
  59. }
  60. }
  61. }
  62. }
  63. </style>