Skip to content

Commit

Permalink
refactor(projects): 主题切换
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed May 13, 2023
1 parent c03fefb commit 5f47381
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script setup lang="ts">
import { watch } from 'vue';
import { useRoute } from 'vue-router';
import { dateZhCN, zhCN } from 'naive-ui';
import { dateZhCN, useThemeVars, zhCN } from 'naive-ui';
import { useI18n } from 'vue-i18n';
import { subscribeStore, useThemeStore } from '@/store';
import { useGlobalEvents } from '@/composables';
Expand Down
11 changes: 11 additions & 0 deletions src/plugins/fast-crud/common.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
html:root {
--baseColor: #fff;
}
/* 深色模式 */
html.dark:root {
--baseColor: #000;
}

.fs-container {
background-color: var(--baseColor);
}
1 change: 1 addition & 0 deletions src/plugins/fast-crud/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { FsSetupOptions, PageQuery } from '@fast-crud/fast-crud';
// eslint-disable-next-line import/order
import { FastCrud } from '@fast-crud/fast-crud';
import '@fast-crud/fast-crud/dist/style.css';
import './common.scss';

import {
FsExtendsCopyable,
Expand Down
2 changes: 1 addition & 1 deletion src/router/modules/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const component: any = {
},
{
name: 'crud_header_group',
path: '/crud/header-group',
path: '/crud/header_group',
component: 'self',
meta: {
title: '多级表头',
Expand Down
4 changes: 2 additions & 2 deletions src/typings/page-route.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare namespace PageRoute {
| 'crud'
| 'crud_demo'
| 'crud_doc'
| 'crud_header-group'
| 'crud_header_group'
| 'crud_source'
| 'dashboard'
| 'dashboard_analysis'
Expand Down Expand Up @@ -96,7 +96,7 @@ declare namespace PageRoute {
| 'component_table'
| 'crud_demo'
| 'crud_doc'
| 'crud_header-group'
| 'crud_header_group'
| 'crud_source'
| 'dashboard_analysis'
| 'dashboard_workbench'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function createCrudOptions(): CreateCrudOptionsRet {
return {
crudOptions: {
container: {
is: 'fs-layout-card'
// is: 'fs-layout-card'
},
request: {
pageRequest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="h-full">
<div class="h-full fs-page-header-group">
<fs-crud ref="crudRef" v-bind="crudBinding" />
</div>
</template>
Expand All @@ -26,3 +26,8 @@ export default defineComponent({
}
});
</script>
<style lang="scss">
.fs-page-header-group {
}
</style>
2 changes: 1 addition & 1 deletion src/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const views: Record<
component_table: () => import('./component/table/index.vue'),
crud_demo: () => import('./crud/demo/index.vue'),
crud_doc: () => import('./crud/doc/index.vue'),
'crud_header-group': () => import('./crud/header-group/index.vue'),
crud_header_group: () => import('./crud/header_group/index.vue'),
crud_source: () => import('./crud/source/index.vue'),
dashboard_analysis: () => import('./dashboard/analysis/index.vue'),
dashboard_workbench: () => import('./dashboard/workbench/index.vue'),
Expand Down

0 comments on commit 5f47381

Please sign in to comment.