feat: 优化 PInputPassword 组件,直接使用 SchemaComponent,移除不必要的组件名称定义
This commit is contained in:
@ -5,14 +5,12 @@ import SchemaComponent from 'primevue/password';
|
|||||||
import { markRaw } from 'vue';
|
import { markRaw } from 'vue';
|
||||||
import { messages } from '../sections/messages';
|
import { messages } from '../sections/messages';
|
||||||
|
|
||||||
const cmpName = `SchemaComponent${SchemaComponent.name}`;
|
|
||||||
|
|
||||||
export const PInputPassword: FormKitTypeDefinition = {
|
export const PInputPassword: FormKitTypeDefinition = {
|
||||||
type: 'input',
|
type: 'input',
|
||||||
schema: outer(
|
schema: outer(
|
||||||
label('$label'),
|
label('$label'),
|
||||||
createSection('input', () => ({
|
createSection('input', () => ({
|
||||||
$cmp: cmpName,
|
$cmp: markRaw(SchemaComponent) as any,
|
||||||
bind: '$attrs',
|
bind: '$attrs',
|
||||||
props: {
|
props: {
|
||||||
invalid: '$state.invalid',
|
invalid: '$state.invalid',
|
||||||
@ -27,9 +25,6 @@ export const PInputPassword: FormKitTypeDefinition = {
|
|||||||
}))(),
|
}))(),
|
||||||
messages(),
|
messages(),
|
||||||
),
|
),
|
||||||
library: {
|
|
||||||
[cmpName]: markRaw(SchemaComponent),
|
|
||||||
},
|
|
||||||
features: [casts],
|
features: [casts],
|
||||||
// schemaMemoKey: 'g2f31c24kjh',
|
// schemaMemoKey: 'g2f31c24kjh',
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user