Page rendering methods and devices
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2026-08-14
AI Technical Summary
然而,在对基于该iframe框架的方式来实现的应用A的页面进行渲染的过程中,在渲染该页面上的所引用的应用B的表单组件时,该页面的iframe高度需要根据所应用B的表单组件进行动态调整,在该页面上渲染出所引用的应用B的表单组件处理复杂度比较高,并且所渲染出的表单效果不佳
Smart Images

Figure CN116204181B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a page rendering method and apparatus. Background Technology
[0002] As browser-based web applications become increasingly diverse, the complexity of application scenarios also increases. In platform-level web applications, there are scenarios where the web page to be rendered in application A may reference components from application B to assemble form content and facilitate interaction.
[0003] In related technologies, an iframe is typically used to reference the form component of application B within the page of application A, and the form component of application B referenced in the page of application A is then rendered based on the iframe. However, during the rendering process of the page of application A implemented using this iframe approach, the height of the iframe on the page needs to be dynamically adjusted according to the form component of application B. This results in high complexity in rendering the referenced form component of application B on the page, and the rendered form effect is unsatisfactory. Summary of the Invention
[0004] This application proposes a page rendering method and apparatus.
[0005] One embodiment of this application proposes a page rendering method, the method comprising: obtaining a form component to be rendered in a page of a main application, wherein the form component to be rendered includes multiple form items, wherein the multiple form items include: some form items defined by the main application and some form items defined by a sub-application corresponding to the main application; traversing the multiple form items; for each traversed form item, if the form item is a form item defined by a sub-application corresponding to the main application, rendering the form item according to the rendering data of the form item of the sub-application in the micro-frontend framework of the main application; and if the form item is a form item defined by the main application, rendering the form item according to the rendering data of the form item in the micro-frontend framework of the main application.
[0006] The page rendering method of this application embodiment, when rendering each form item of the form component to be rendered in the main application's page, determines whether each form item is defined by the main application or by a sub-application corresponding to the main application. If the form item is defined by a sub-application corresponding to the main application, it is rendered according to the rendering data of the sub-application's form items in the main application's micro-frontend framework; if the form item is defined by the main application, it is rendered according to the rendering data of the form items in the main application's micro-frontend framework. Thus, it achieves rendering of both form items defined by the main application and form items defined by sub-applications in the main application's page, ensuring that the rendered main application page contains both form items defined by the main application and form items defined by sub-applications.
[0007] Another embodiment of this application proposes a page rendering apparatus, the apparatus comprising: an acquisition module, configured to acquire a form component to be rendered in a page of a main application, wherein the form component to be rendered includes multiple form items, wherein the multiple form items include: some form items defined by the main application and some form items defined by a sub-application corresponding to the main application; a traversal module, configured to traverse the multiple form items; a first rendering module, configured to render each traversed form item, if the form item is a form item defined by a sub-application corresponding to the main application, according to the rendering data of the form item of the sub-application in the micro-frontend framework of the main application; and a second rendering module, configured to render the form item, if the form item is a form item defined by the main application, according to the rendering data of the form item in the micro-frontend framework of the main application.
[0008] The page rendering apparatus of this application, when rendering each form item of a form component to be rendered in the page of a main application, determines whether each form item is defined by the main application or by a sub-application corresponding to the main application. If the form item is defined by a sub-application corresponding to the main application, the form item is rendered based on the rendering data of the sub-application's form items in the micro-frontend framework of the main application. If the form item is defined by the main application, the form item is rendered based on the rendering data of the form items in the micro-frontend framework of the main application. Thus, it achieves rendering of both form items defined by the main application and form items defined by sub-applications in the page of the main application, so that the rendered page of the main application contains both form items defined by the main application and form items defined by sub-applications.
[0009] Another embodiment of this application proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the page rendering method of the embodiments of this application.
[0010] Another embodiment of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the page rendering method of the embodiments of this application.
[0011] Another embodiment of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the page rendering method of the embodiments of this application. Attached Figure Description
[0012] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this application. Wherein:
[0013] Figure 1 This is a schematic flowchart of a page rendering method according to an embodiment of this application;
[0014] Figure 2 This is a schematic flowchart of a page rendering method according to another embodiment of this application;
[0015] Figure 3 This is a schematic flowchart of a page rendering method according to another embodiment of this application;
[0016] Figure 4 This is an example diagram illustrating the interaction between the main application, sub-application, and the main application's page, as shown in this application.
[0017] Figure 5 This is a schematic diagram of the structure of a page rendering apparatus according to an embodiment of this application;
[0018] Figure 6 This is a block diagram of an electronic device according to an embodiment of the present application. Detailed Implementation
[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0020] To improve the development efficiency of front-end web application pages, related technologies have proposed developing application pages based on micro-frontend frameworks. Specifically, micro-frontend frameworks can be used to develop application A's pages that reference form items from application B, as well as application A's custom form items. For pages developed based on micro-frontend frameworks, how to render form components in pages developed based on microservice frameworks is a technical problem that urgently needs to be solved.
[0021] To address this, this application proposes a page rendering method. When rendering each form item of a form component to be rendered in the main application's page, this method determines whether each form item is defined by the main application or by a corresponding sub-application. If the form item is defined by a sub-application corresponding to the main application, the method renders the form item based on the rendering data of the sub-application's form items in the main application's micro-frontend framework. Conversely, if the form item is defined by the main application, the method renders it based on the rendering data of the form items in the main application's micro-frontend framework. This achieves the rendering of both form items defined by the main application and those defined by sub-applications in the main application's page, ensuring that the rendered main application page contains both form items defined by the main application and those defined by the sub-applications.
[0022] Among them, the micro front-end framework is a framework similar to microservices. It draws on the architectural concept of microservices to break down a large front-end application into multiple independent and flexible small applications. Each small application can be developed, run, and deployed independently, and then these small applications are combined into a complete application.
[0023] The following description, with reference to the accompanying drawings, describes page rendering, apparatus, electronic device, and storage medium according to embodiments of this application.
[0024] Figure 1 This is a schematic flowchart of a page rendering method according to an embodiment of this application. It should be noted that the page rendering method provided in this embodiment is executed by a page rendering device. The page rendering device in this embodiment can be implemented by software and / or hardware, and can be an electronic device or configured within an electronic device.
[0025] In this example embodiment, the electronic device may include a terminal device, a server, etc. The terminal device may be a PC (Personal Computer), a mobile device, a tablet computer, etc., and this embodiment does not specifically limit it.
[0026] like Figure 1 As shown, the page rendering method may include:
[0027] Step 101: Obtain the form component to be rendered from the main application's page, wherein the form component to be rendered includes multiple form items.
[0028] The form items include: some form items defined by the main application and some form items defined by the sub-applications corresponding to the main application.
[0029] Step 102: Iterate through multiple form items.
[0030] Step 103: For each form item traversed, if the form item is a form item defined by the sub-application corresponding to the main application, render the form item according to the rendering data of the form item of the sub-application in the micro-frontend framework of the main application.
[0031] In other words, for each form item encountered, it can be determined whether the form item is defined by the main application or by a sub-application corresponding to the main application. If the form item is defined by a sub-application corresponding to the main application, the sub-application resources of the sub-application are obtained from the micro-frontend framework of the main application; the rendering data of the form item is obtained from the sub-application resources; and the form item is rendered according to the rendering data of the form item.
[0032] It can be understood that, in order to obtain the sub-application resources of the sub-application from the micro-frontend framework of the main application, the sub-application resource configuration information of the sub-application can be pre-set in the micro-frontend framework of the main application. Correspondingly, when the main application runs based on the micro-frontend framework, the micro-frontend framework can initialize the sub-application based on the sub-application resource configuration information of the sub-application to obtain the sub-application resources corresponding to the sub-application.
[0033] Sub-application resources refer to the collection of various resources corresponding to a sub-application. For example, application resources may include, but are not limited to, static resource files such as Cascading Style Sheets (CSS) and JavaScript.
[0034] Step 104: If the form items are defined by the main application, render the form items according to the rendering data of the form items in the micro-frontend framework of the main application.
[0035] It is understandable that, in different application scenarios, the implementation methods for rendering form items differ based on the rendering data of the form items in the main application's micro-frontend framework. Examples are illustrated below:
[0036] As an example, callback functions corresponding to form items can be obtained from the micro-frontend framework of the main application; rendering data for the form items can be obtained from the micro-frontend framework through the callback functions; and the form items can be rendered based on the rendering data. Thus, the rendering data for the corresponding form items is obtained from the micro-frontend framework of the main application through callback functions, and the corresponding form items are rendered based on the obtained rendering data.
[0037] As another example, the main application resources of the main application can be obtained from the micro-frontend framework of the main application; the rendering data of the form items can be obtained from the main application resources; and the form items can be rendered based on the rendering data of the form items.
[0038] Among them, main application resources refer to the various resources corresponding to the main application.
[0039] In one exemplary embodiment of this application, the routing information of the main application can be obtained from the micro-frontend framework of the main application, and the main application resources of the main application can be obtained from the micro-frontend framework based on the routing information of the main application. The correspondence between form items and rendering data can be obtained from the main application resources, and the rendering data of the form item can be obtained based on the correspondence.
[0040] It should be noted that when the main application's page has custom form items set in the components to be rendered, the main application resource configuration information containing the configuration information of the custom form items can be pre-set in the micro-frontend framework corresponding to the main application. Correspondingly, when the main application runs based on the micro-frontend framework, the micro-frontend framework can generate main application resources containing rendering data of the custom form items based on the pre-set main application resource configuration information, so that the rendering data of the corresponding form items can be obtained from the main application resources later.
[0041] In this example, the form items defined by the main application and the form items defined by the sub-application can be displayed in an alternating pattern on the main application's page. That is, in some examples, a form item defined by the sub-application is displayed between two form items defined by the main application. In other examples, a form item defined by the main application is displayed between two form items defined by the sub-application.
[0042] The page rendering method of this application embodiment, when rendering each form item of the form component to be rendered in the main application's page, determines whether each form item is defined by the main application or by a sub-application corresponding to the main application. If the form item is defined by a sub-application corresponding to the main application, it is rendered according to the rendering data of the sub-application's form items in the main application's micro-frontend framework; if the form item is defined by the main application, it is rendered according to the rendering data of the form items in the main application's micro-frontend framework. Thus, it achieves rendering of both form items defined by the main application and form items defined by sub-applications in the main application's page, ensuring that the rendered main application page contains both form items defined by the main application and form items defined by sub-applications.
[0043] Figure 2 This is a schematic flowchart of a page rendering method according to another embodiment of this application. This embodiment is a further refinement of the previous embodiment.
[0044] like Figure 2 As shown, the page rendering method may include:
[0045] Step 201: Obtain the form component to be rendered from the main application's page, wherein the form component to be rendered includes multiple form items.
[0046] The form items include: some form items defined by the main application and some form items defined by the sub-applications corresponding to the main application.
[0047] Step 202: Iterate through multiple form items.
[0048] Step 203: For each form item traversed, if the form item is a form item defined by the sub-application corresponding to the main application, obtain the routing information of the sub-application from the micro-frontend framework of the main application.
[0049] The routing information for sub-applications may include information such as the sub-application resource name and the sub-application resource address.
[0050] It is understood that the routing information of the aforementioned sub-applications can be pre-set in the micro-frontend framework of the main application.
[0051] Step 204: Obtain the sub-application resources of the sub-application from the micro-frontend framework based on the routing information.
[0052] Step 205: Obtain the rendering data of the form items from the sub-application resources.
[0053] The rendering data for a form item refers to the various data required to render that form item.
[0054] Step 206: Render the form items according to the rendering data of the form items.
[0055] Step 207: If the form items are defined by the main application, render the form items according to the rendering data of the form items in the micro-frontend framework of the main application.
[0056] It should be noted that the specific implementation of step 207 can be found in the relevant description of the embodiments of this application, and will not be repeated here.
[0057] The page rendering method of this application embodiment, when rendering each form item of a form component to be rendered in the main application's page, determines whether each form item is defined by the main application or by a sub-application corresponding to the main application. If the form item is defined by a sub-application corresponding to the main application, the sub-application resources of the sub-application are obtained from the micro-frontend framework of the main application, and the rendering data of the form item is obtained from the sub-application resources. The form item is then rendered based on the rendering data. Conversely, if the form item is defined by the main application, the form item is rendered based on the rendering data of the form item in the micro-frontend framework of the main application. Thus, the rendering of both form items defined by the main application and form items defined by sub-applications in the main application's page is achieved, ensuring that the rendered main application page contains both form items defined by the main application and form items defined by sub-applications.
[0058] To ensure a clear understanding of this application, the following will be combined with... Figure 3 and Figure 4 The page rendering method of this embodiment is described exemplarily. It should be noted that the example of the form module of the sub-application in this example embodiment is as follows: Figure 4 As shown by mark A, it can be seen from mark A that the form module of the sub-application includes three form items. Figure 4 The following example uses standard form field 1, standard form field 2, and standard form field 3. Correspondingly, when developing form components in the main application's page based on the form module of this sub-application, assuming the main application's form component includes five form fields, three of which are provided by the sub-application's form module, and the other two are custom extensions of the main application, in... Figure 4 The main application's custom extended form items are represented by Custom Extended Form Item 1 and Custom Extended Form Item 2, respectively. The positional relationship of the five form items in the main application's form component on the page is as follows: Figure 4 The example at mark B shows that the positional relationship of the form components in the main application is: Standard Form Item 1, Standard Form Item 2, Custom Extended Form Item 1, Standard Form Item 3, Custom Extended Form Item 2.
[0059] In this example, it is understood that the sub-application refers to a sub-application that provides a form module. That is, the sub-application in this example refers to a sub-application that provides form functionality.
[0060] like Figure 3 As shown, the page rendering method may include:
[0061] Step 303: Configure the routing information of the sub-application and the extended form item information customized by the main application in the micro-frontend framework used by the main application.
[0062] Specifically, the development of sub-applications such as Figure 4 After the form module is shown, the routing information of the sub-application can be added in the application registration configuration of the micro-frontend framework. This will facilitate the subsequent retrieval of the sub-application's resources based on the sub-application's routing information, and then the rendering of the form items based on the rendering data of the form items included in the sub-application resources.
[0063] Specifically, the main application's custom extended form item information can be added to the application registration configuration of the micro-frontend framework, so that the micro-frontend framework can store the rendering data of the extended form items defined by the main application in the future.
[0064] The extended form item information may include, but is not limited to, the identification information of the extended form item and the rendering configuration information.
[0065] Step 302: In the micro-frontend framework, set the form item information corresponding to the position of each form item in the form component of the main application's page.
[0066] The form item information may include the form item identifier information corresponding to each form item position and the routing information of the application to which the form item belongs.
[0067] Understandably, for each form item position, if the form item at that position is any extended form item defined by the main application, the form item information for that position includes the form item identifier and the routing information of the main application to which that form item belongs. Conversely, if the form item at that position is any standard form item defined by a sub-application, the form item information for that position includes the form item identifier and the routing information of the sub-application to which that form item belongs.
[0068] Step 303: After setting the relevant information of the form components of the main application's page in the micro-frontend framework, render the form components in the main application's page based on the set information, so as to display the combination and arrangement of the extended form items defined by the main application and the standard form items defined by the sub-application in the main application's page.
[0069] Specifically, when rendering form components in the main application's page, for each form item position, the form item information at that position can be used to determine whether it is an extended form item defined by the main application or a standard form item defined by a sub-application. If the form item at that position is an extended form item defined by the main application, the main application resources of the main application can be obtained from the micro-frontend framework based on the main application's routing information, and the rendering data of the form item can be obtained from the main application resources. The form item is then rendered based on the obtained rendering data. Conversely, if the form item at that position is a standard form item defined by a sub-application, the sub-application resources of the sub-application can be obtained from the micro-frontend framework based on the sub-application's routing information, and the rendering data of the form item can be obtained from the sub-application resources. The form item is then rendered based on the obtained rendering data.
[0070] In this example, by importing information about the sub-application of the form module into the micro-frontend framework of the main application and setting relevant information about the extended form items defined by the main application in the micro-frontend framework, the combination of extended form items and general form items defined by the sub-application can be displayed on the main application's page when rendering the main application's page. This satisfies the requirement of importing form items from the sub-application and custom extended form items from the main application into the main application's page.
[0071] Corresponding to the page rendering methods provided in the above embodiments, one embodiment of this application also provides a page rendering apparatus. Since the page rendering apparatus provided in this application corresponds to the page rendering methods provided in the above embodiments, the implementation methods of the page rendering methods are also applicable to the page rendering apparatus of this embodiment, and will not be described in detail in this embodiment.
[0072] Figure 5 This is a schematic diagram of the structure of a page rendering apparatus according to an embodiment of this application.
[0073] like Figure 5 As shown, the page rendering device 500 includes: an acquisition module 501, a traversal module 502, a first rendering module 503, and a second rendering module 504. Wherein:
[0074] The acquisition module 501 is used to acquire the form component to be rendered in the page of the main application. The form component to be rendered includes multiple form items, including some form items defined by the main application and some form items defined by the sub-application corresponding to the main application.
[0075] The traversal module 502 is used to traverse multiple form items.
[0076] The first rendering module 503 is used to render each form item for each traversed form item, provided that the form item is a form item defined by the sub-application corresponding to the main application, based on the rendering data of the form items of the sub-application in the micro-frontend framework of the main application.
[0077] The second rendering module 504 is used to render the form items based on the rendering data of the form items in the micro-frontend framework of the main application, when the form items are form items defined by the main application.
[0078] In one embodiment of this application, the first rendering module 503 includes:
[0079] The first acquisition unit is used to acquire sub-application resources from the micro-frontend framework of the main application.
[0080] The second acquisition unit is used to obtain the rendering data of form items from the sub-application resources;
[0081] The rendering unit is used to render form items based on the rendering data of the form items.
[0082] In one embodiment of this application, the first acquisition unit is specifically used to: acquire routing information of the sub-application from the micro-frontend framework of the main application; and acquire sub-application resources of the sub-application from the micro-frontend framework based on the routing information.
[0083] In one embodiment of this application, the second rendering module is specifically used for: obtaining the callback function corresponding to the form item from the micro-frontend framework of the main application; obtaining the rendering data of the form item from the micro-frontend framework through the callback function; and rendering the form item according to the rendering data of the form item.
[0084] In one embodiment of this application, the second rendering module is specifically used for: obtaining the main application resources of the main application from the micro-frontend framework of the main application; obtaining the rendering data of the form items from the main application resources; and rendering the form items according to the rendering data of the form items.
[0085] In one embodiment of this application, a form item defined by a sub-application is displayed between two form items defined by the main application in the page display position, or a form item defined by the main application is displayed between two form items defined by the sub-application in the page display position.
[0086] The page rendering apparatus of this application, when rendering each form item of a form component to be rendered in the page of a main application, determines whether each form item is defined by the main application or by a sub-application corresponding to the main application. If the form item is defined by a sub-application corresponding to the main application, the form item is rendered based on the rendering data of the sub-application's form items in the micro-frontend framework of the main application. If the form item is defined by the main application, the form item is rendered based on the rendering data of the form items in the micro-frontend framework of the main application. Thus, it achieves rendering of both form items defined by the main application and form items defined by sub-applications in the page of the main application, so that the rendered page of the main application contains both form items defined by the main application and form items defined by sub-applications.
[0087] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.
[0088] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application.
[0089] like Figure 6 As shown, the electronic device 600 includes: a memory 610, a processor 620, and computer instructions stored in the memory 610 and executable on the processor 620.
[0090] When the processor 620 executes instructions, it implements the page rendering method provided in the above embodiments.
[0091] Furthermore, the electronic device 600 also includes:
[0092] Communication interface 630 is used for communication between memory 610 and processor 620.
[0093] The memory 610 is used to store computer instructions that can be run on the processor 620.
[0094] The memory 610 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0095] The processor 620 is used to implement the page rendering method of the above embodiments when executing the program.
[0096] If the memory 610, processor 620, and communication interface 630 are implemented independently, then the communication interface 630, memory 610, and processor 620 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0097] Optionally, in a specific implementation, if the memory 610, processor 620, and communication interface 630 are integrated on a single chip, then the memory 610, processor 620, and communication interface 630 can communicate with each other through an internal interface.
[0098] The processor 620 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0099] Another embodiment of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the page rendering method disclosed in the embodiments of this application.
[0100] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0101] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0102] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A page rendering method, characterized in that, The method includes: Obtain the form component to be rendered in the page of the main application, wherein the form component to be rendered includes multiple form items, wherein the multiple form items include: some form items defined by the main application and some form items defined by the sub-application corresponding to the main application, and the form items defined by the main application and the form items defined by the sub-application are displayed in an alternating manner on the page of the main application; Iterate through the multiple form items; For each form item encountered during the iteration, if the form item is a form item defined by a sub-application corresponding to the main application, the form item is rendered according to the rendering data of the form item of the sub-application in the micro-frontend framework of the main application. If the form item is a form item defined by the main application, the form item is rendered according to the rendering data of the form item in the micro-frontend framework of the main application.
2. The method as described in claim 1, characterized in that, The step of rendering the form items based on the rendering data of the form items in the sub-application within the micro-frontend framework of the main application includes: Obtain the sub-application resources of the sub-application from the micro-frontend framework of the main application; Obtain the rendering data of the form items from the sub-application resources; The form items are rendered based on the rendering data of the form items.
3. The method as described in claim 2, characterized in that, The step of obtaining the sub-application resources of the sub-application from the micro-frontend framework of the main application includes: Obtain the routing information of the sub-application from the micro-frontend framework of the main application; Based on the routing information, the sub-application resources of the sub-application are obtained from the micro-frontend framework.
4. The method as described in claim 1, characterized in that, The step of rendering the form items based on the rendering data of the form items in the micro-frontend framework of the main application includes: Obtain the callback function corresponding to the form item from the micro-frontend framework of the main application; The rendering data of the form items is obtained from the micro-frontend framework through the callback function; The form items are rendered based on the rendering data of the form items.
5. The method as described in claim 1, characterized in that, The step of rendering the form items based on the rendering data of the form items in the micro-frontend framework of the main application includes: Obtain the main application resources of the main application from the micro-frontend framework of the main application; Obtain the rendering data of the form items from the main application resources; The form items are rendered based on the rendering data of the form items.
6. The method according to any one of claims 1-5, characterized in that, The form items defined by the sub-application are displayed between two form items defined by the main application in the page display position of the plurality of form items, or the form items defined by the main application are displayed between two form items defined by the sub-application in the page display position of the plurality of form items.
7. A page rendering device, characterized in that, The device includes: The acquisition module is used to acquire the form component to be rendered in the page of the main application. The form component to be rendered includes multiple form items, which include: some form items defined by the main application and some form items defined by the sub-application corresponding to the main application. The form items defined by the main application and the form items defined by the sub-application are displayed in an alternating manner on the page of the main application. The traversal module is used to traverse the multiple form items; The first rendering module is used to render each form item for each traversed form item, provided that the form item is a form item defined by a sub-application corresponding to the main application, based on the rendering data of the form item of the sub-application in the micro-frontend framework of the main application. The second rendering module is used to render the form item according to the rendering data of the form item in the micro-frontend framework of the main application when the form item is a form item defined by the main application.
8. The apparatus as claimed in claim 7, characterized in that, The first rendering module includes: The first acquisition unit is used to acquire the sub-application resources of the sub-application from the micro-frontend framework of the main application; The second acquisition unit is used to acquire the rendering data of the form item from the sub-application resource; A rendering unit is used to render the form items according to the rendering data of the form items.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the program, implements the method as described in any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Webpage synchronization method and device, equipment and storage medium
CN112612449A
Method for realizing dynamic mounting of global container based on Qiankun micro front end
CN114741638A