import { ISchema, useField, useFieldSchema } from '@formily/react'; import React from 'react'; import { GeneralSchemaDesigner, SchemaSettings, useDesignable } from '../../../'; export const MenuDesigner = () => { const field = useField(); const fieldSchema = useFieldSchema(); const { dn, refresh } = useDesignable(); return ( { const schema = { ['x-uid']: fieldSchema['x-uid'], }; if (title) { fieldSchema.title = title; field.title = title; schema['title'] = title; refresh(); } field.componentProps.icon = icon; schema['x-component-props'] = { icon }; fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {}; fieldSchema['x-component-props']['icon'] = icon; dn.emit('patch', { schema, }); }} /> ); };