Open hyzx86 opened 1 year ago
Since there is already a service to register custom JS methods, can't this be used too to dynamically inject the definitions? Or maybe create another event for any module to do this, which would replace ocTypes
in your example. Maybe this would be just passing some script to the event, with enums and function declarations.
Done,
I have regested all of parts to ContentItem in typescript
type ContentItem = {
ContentItemId: string;
ContentItemVersionId: string;
ContentType: string
DisplayText: string
Latest: boolean
Published: boolean
ModifiedUtc: string
PublishedUtc: string
Owner: string
Author: string
//后台替换
//Don't Change any thing
/*Content: $CONTENTPARTS$*/
}
and then use all of contentPart Schema to replace /*Content: $CONTENTPARTS$*/
Here's a little try : https://github.com/OrchardCMS/OrchardCore/pull/12845#issuecomment-2076774058
Is your feature request related to a problem? Please describe.
Many custom js function extensions are implemented in OC, but you need to query the document to determine the usage of these functions each time
Describe the solution you'd like
Functions and objects registered by Jint can be prompted using the suggestions function of Monaco editor
In my project , this method works well
(Partial code)
Describe alternatives you've considered
var blogPost:BlogPost =newContentItem() ;
var blogPost =newContentItem() as BlogPost;
blogPost.BlogPost.ContentBody.Text="My BlogContent"