feat: 使用 markRaw 包装消息组件,优化性能
Some checks failed
/ test (push) Failing after 30s
/ surge (push) Successful in 41s

This commit is contained in:
严浩
2024-11-24 23:29:52 +08:00
parent ab5cf852ff
commit 11f787d172

View File

@ -1,8 +1,9 @@
import MessagesCmp from '@/__fk-inputs__/components/messages.vue';
import { createSection } from '@formkit/inputs';
import { markRaw } from 'vue';
export const messages = createSection('messages', () => ({
$cmp: MessagesCmp as any,
$cmp: markRaw(MessagesCmp) as any, // [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)',
}))