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