feat: 更新自定义切换组件,重命名为 headlessui-switch 并调整类型定义
This commit is contained in:
@@ -6,9 +6,9 @@ declare module '@formkit/inputs' {
|
||||
// https://formkit.com/essentials/custom-inputs#typescript-support
|
||||
interface FormKitInputProps<Props extends FormKitInputs<Props>> {
|
||||
// This key and the `type` should match:
|
||||
'mytoggle': {
|
||||
'headlessui-switch': {
|
||||
// Define your input `type`:
|
||||
type: 'mytoggle',
|
||||
type: 'headlessui-switch',
|
||||
someProp: string,
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,7 @@ declare module '@formkit/inputs' {
|
||||
import { Switch, SwitchGroup, SwitchLabel } from '@headlessui/vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps<{
|
||||
context: FormKitFrameworkContext;
|
||||
}>();
|
||||
const props = defineProps<{ context: FormKitFrameworkContext; }>();
|
||||
|
||||
|
||||
const value = computed({
|
||||
|
@@ -148,7 +148,7 @@ onMounted(() => {
|
||||
|
||||
<FormKit
|
||||
label="headlessui"
|
||||
type="mytoggle"
|
||||
type="headlessui-switch"
|
||||
/>
|
||||
|
||||
<FormKit
|
||||
|
Reference in New Issue
Block a user