Skip to content

Commit

Permalink
ColorOption
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Sep 21, 2024
1 parent 5ba766a commit dc5692a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/option/ColorOption.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script setup lang="ts">
import { NColorPicker } from 'naive-ui'
defineProps<{
value: string
onUpdate: (value: string) => void
}>()
</script>

<template>
<NColorPicker
:modes="['hex']"
show-preview
:value="value"
@update:value="onUpdate"
/>
</template>
3 changes: 3 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import IntegerOption from './option/IntegerOption.vue'
import BooleanOption from './option/BooleanOption.vue'
import EnumOption from './option/EnumOption.vue'
import KeyOption from './option/KeyOption.vue'
import ColorOption from './option/ColorOption.vue'
import StringOption from './option/StringOption.vue'
import ExternalOption from './option/ExternalOption.vue'
import ListOption from './option/ListOption.vue'
Expand Down Expand Up @@ -39,6 +40,8 @@ export function toComponent(child: { Type: string, Children?: any[] | null } & {
return EnumOption
case 'Key':
return KeyOption
case 'Color':
return ColorOption
case 'String':
if (child.IsEnum === 'True') {
return EnumOption
Expand Down

0 comments on commit dc5692a

Please sign in to comment.