-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
165 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<k-content> | ||
<k-form v-model="config" :initial="config" :schema="schema"></k-form> | ||
</k-content> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { config } from '..' | ||
import { Schema } from '@koishijs/components' | ||
const schema = Schema.object({ | ||
theme: Schema.object({ | ||
mode: Schema.union([ | ||
Schema.const('auto').description('跟随系统'), | ||
Schema.const('dark').description('深色'), | ||
Schema.const('light').description('浅色'), | ||
]).description('主题偏好。'), | ||
dark: Schema.string().role('theme', { mode: 'dark' }).description('深色主题。'), | ||
light: Schema.string().role('theme', { mode: 'light' }).description('浅色主题。'), | ||
}).description('主题设置'), | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Context } from '..' | ||
import components from '@koishijs/components' | ||
import Settings from './index.vue' | ||
import Theme from './theme.vue' | ||
|
||
components.extensions.add({ | ||
type: 'string', | ||
role: 'theme', | ||
component: Theme, | ||
}) | ||
|
||
export default function (ctx: Context) { | ||
ctx.page({ | ||
path: '/settings/:name*', | ||
name: '用户设置', | ||
icon: 'activity:settings', | ||
position: 'bottom', | ||
order: -100, | ||
component: Settings, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters