格式化代码
This commit is contained in:
@ -11,14 +11,16 @@
|
||||
:key="message.key"
|
||||
:id="`${context.id}-${message.key}`"
|
||||
:data-message-type="message.type"
|
||||
>{{ message.value }}</li>
|
||||
>
|
||||
{{ message.value }}
|
||||
</li>
|
||||
</ul>
|
||||
<!-- </template> -->
|
||||
</Message>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { FormKitFrameworkContext } from '@formkit/core';
|
||||
import { type FormKitFrameworkContext } from '@formkit/core';
|
||||
import Message from 'primevue/message';
|
||||
defineProps<{ context: FormKitFrameworkContext }>();
|
||||
</script>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FormKitTypeDefinition } from '@formkit/core';
|
||||
import type { FormKitTypeDefinition } from '@formkit/core';
|
||||
import { actions, submitInput, forms, disablesChildren, createSection } from '@formkit/inputs';
|
||||
import { messages } from '../sections/messages';
|
||||
import PButton from 'primevue/button';
|
||||
@ -24,7 +24,7 @@ export const form: FormKitTypeDefinition = {
|
||||
messages(),
|
||||
actions(submitInput()),
|
||||
createSection('button', () => ({
|
||||
$cmp: markRaw(PButton) as any,
|
||||
$cmp: markRaw(PButton) as never,
|
||||
bind: '$submitAttrs',
|
||||
props: {
|
||||
type: 'submit',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FormKitTypeDefinition } from '@formkit/core';
|
||||
import type { FormKitTypeDefinition } from '@formkit/core';
|
||||
import type { FormKitInputs } from '@formkit/inputs';
|
||||
import { casts, createSection, label, outer } from '@formkit/inputs';
|
||||
import SchemaComponent from 'primevue/password';
|
||||
@ -10,7 +10,7 @@ export const PInputPassword: FormKitTypeDefinition = {
|
||||
schema: outer(
|
||||
label('$label'),
|
||||
createSection('input', () => ({
|
||||
$cmp: markRaw(SchemaComponent) as any,
|
||||
$cmp: markRaw(SchemaComponent) as never,
|
||||
bind: '$attrs',
|
||||
props: {
|
||||
invalid: '$state.invalid',
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FormKitTypeDefinition } from '@formkit/core';
|
||||
import type { FormKitTypeDefinition } from '@formkit/core';
|
||||
import type { FormKitInputs } from '@formkit/inputs';
|
||||
import { casts, createSection, label, outer } from '@formkit/inputs';
|
||||
import SchemaComponent from 'primevue/inputtext';
|
||||
|
@ -3,7 +3,7 @@ import { createSection } from '@formkit/inputs';
|
||||
import { markRaw } from 'vue';
|
||||
|
||||
export const messages = createSection('messages', () => ({
|
||||
$cmp: markRaw(MessagesCmp) as any, // [element = node.$cmp](https://github.com/formkit/formkit/blob/2d5387ba98597775cb2a752af65aee84bc438863/packages/vue/src/FormKitSchema.ts#L449)
|
||||
$cmp: markRaw(MessagesCmp) as unknown as never, // [element = node.$cmp](https://github.com/formkit/formkit/blob/2d5387ba98597775cb2a752af65aee84bc438863/packages/vue/src/FormKitSchema.ts#L449)
|
||||
props: { context: '$node.context' },
|
||||
if: '$defaultMessagePlacement && $fns.length($messages)',
|
||||
}));
|
||||
|
Reference in New Issue
Block a user