Component rendering method and device, computer equipment, storage medium and program product
Through the scanning engine, the front-end page document is scanned and processed, and the rendering components are obtained and rendered, which solves the problem of inefficient component rendering in the existing technology, realizes efficient creation and rendering of components, and simplifies the development process.
Patent Information
- Application Number
- CN202411125705.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-22
AI Technical Summary
The existing technology requires manual writing of JavaScript code during component rendering, which is inefficient and lacks the ability to automatically scan and create.
The front-end page document is scanned through the scanning engine, and the rendering components are obtained, and the pre-configured component properties and constructors are rendered to realize the automatic creation and rendering of components.
It significantly improves the efficiency of component rendering, reduces the amount of business code development, simplifies the use of components, and improves development efficiency.
Smart Images

Figure CN119002915A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of component design, and in particular to a component rendering method, apparatus, computer equipment, storage medium and program product. Background Art
[0002] As front-end development becomes increasingly complex, component-based development has emerged. The three most commonly used front-end frameworks, React, Vue, and Angular, have all developed and implemented component-based systems for their own frameworks. These solutions have been widely used and practiced by many manufacturers and can serve actual business well.
[0003] However, no matter which framework is used, when rendering components, it is necessary to manually create rendering by writing JavaScript code, which is too inefficient. Summary of the invention
[0004] Based on this, it is necessary to provide a component rendering method, device, computer equipment, storage medium and program product that can improve efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a component rendering method, the method comprising:
[0006] The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components;
[0007] For the loaded rendering components, rendering processing is performed on each rendering component according to the pre-configured component properties and component constructor to obtain the rendering result.
[0008] In one embodiment, the method further comprises:
[0009] For the unloaded rendering components, the loading function is called by the module loading engine to perform component loading processing, and the front-end page document is scanned by the scanning engine to obtain the steps of multiple rendering components.
[0010] In one embodiment, the rendering process is performed on each rendering component according to the pre-configured component properties and component constructor to obtain a rendering result, including:
[0011] Filter the properties of each rendering component according to the component properties to obtain the target properties of each rendering component;
[0012] Input each target attribute into the component constructor for rendering to obtain the rendering result.
[0013] In one embodiment, the front-end page document is scanned and processed to obtain multiple rendering components, including:
[0014] Determine the area to be scanned in the front-end page document;
[0015] The area to be scanned is scanned to obtain various rendering components.
[0016] In one embodiment, the scanning process is performed on the area to be scanned to obtain multiple rendering components, including:
[0017] When the area to be scanned includes a local area, scanning and processing are performed on page elements in the local area to obtain multiple rendering components;
[0018] When the area to be scanned includes the global area, the page elements of the global area are scanned to obtain various rendering components.
[0019] In one embodiment, the configuration process of the component attributes includes:
[0020] Get the component name;
[0021] The attribute values of each attribute corresponding to the component name are configured and processed to obtain the component attributes.
[0022] In one embodiment, the method further comprises:
[0023] The component is defined through the module loading engine to obtain the component name and component method body; the component method body is used to indicate the rendering logic of the component.
[0024] In a second aspect, the present application also provides a component rendering device. The device includes:
[0025] The component determination module is used to scan and process the front-end page document through a scanning engine to obtain multiple rendering components;
[0026] The component rendering module is used to render each loaded rendering component according to pre-configured component properties and component constructors to obtain rendering results.
[0027] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0028] The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components;
[0029] For the loaded rendering components, rendering processing is performed on each rendering component according to the pre-configured component properties and component constructor to obtain the rendering result.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0031] The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components;
[0032] For the loaded rendering components, rendering processing is performed on each rendering component according to the pre-configured component properties and component constructor to obtain the rendering result.
[0033] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0034] The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components;
[0035] For the loaded rendering components, rendering processing is performed on each rendering component according to the pre-configured component properties and component constructor to obtain the rendering result.
[0036] The above-mentioned component rendering method, device, computer equipment, storage medium and program product scan and process the front-end page document through a scanning engine to obtain multiple rendering components; for the loaded rendering components, each rendering component is rendered according to the pre-configured component properties and component constructor to obtain a rendering result. This application helps businesses to achieve efficient creation and rendering of components through pre-configured component properties and component constructors, reduces the amount of business code development, greatly facilitates the use of components by businesses, and improves development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 An application environment diagram of a component rendering method in an embodiment;
[0038] Figure 2 A schematic diagram of a component rendering method in one embodiment;
[0039] Figure 3 A schematic diagram of a process for obtaining a rendering result in one embodiment;
[0040] Figure 4 A schematic diagram of a process for obtaining multiple rendering components in one embodiment;
[0041] Figure 5 A schematic diagram of a process flow of configuring component attributes in one embodiment;
[0042] Figure 6 It is a structural block diagram of a component rendering device in one embodiment;
[0043] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] First of all, before specifically introducing the technical solution of the embodiments of the present application, the technical background based on the embodiments of the present application is introduced.
[0046] At present, traditional JavaScript component libraries are all modularly developed based on the AMD (Asynchronous Module Definition) specification and the CMD (Common Module Definition) specification. When using them, you need to manually create and render by writing JavaScript code, and there is no automatic scanning and creation capability.
[0047] Based on this, the present application provides a component rendering method, apparatus, computer device, storage medium and program product, aiming to solve the above technical problems.
[0048] The component rendering method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Component rendering method, device, computer equipment, storage medium and program product, scan and process the front-end page document through a scanning engine to obtain multiple rendering components; for the loaded rendering components, render each rendering component according to the pre-configured component properties and component constructor to obtain a rendering result. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones and tablets. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0049] In an exemplary embodiment, Figure 2 As shown, a component rendering method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0050] S201, scanning and processing the front-end page document through a scanning engine to obtain multiple rendering components.
[0051] Among them, the role of the scanning engine is to scan the elements on the front-end page, find the target elements, and automatically create and render the components. The rendering components can be obtained by rendering form elements, text box elements, etc.
[0052] In the embodiment of the present application, the terminal can control the scanning engine to start, so as to control the scanning engine to scan the front-end page document to obtain multiple rendering components. The scanning process may include finding components that have not been created and creating them.
[0053] S202: For the loaded rendering components, rendering processing is performed on each rendering component according to pre-configured component properties and component constructors to obtain rendering results.
[0054] Among them, component attributes are the attributes of the page component. For example, using the input component, configure the width and value attributes of the input.
[0055] In an embodiment of the present application, based on the rendering component obtained in the above embodiment, for the loaded rendering component, the component properties that need to be rendered can be obtained by obtaining the component tag of the rendering component, and the pre-configured component properties can be obtained, and the pre-configured component properties can be input into the component constructor for construction processing to achieve the effect of rendering processing on each rendering component, so as to obtain the rendering result displayed on the front-end page.
[0056] The above-mentioned component rendering method scans and processes the front-end page document through a scanning engine to obtain multiple rendering components; for the loaded rendering components, each rendering component is rendered according to the pre-configured component properties and component constructor to obtain a rendering result. The embodiment of the present application helps the business to achieve efficient creation and rendering of components through pre-configured component properties and component constructors, reduces the amount of business code development, greatly facilitates the use of components by the business, and improves development efficiency.
[0057] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application further includes:
[0058] For the unloaded rendering components, the loading function is called by the module loading engine to perform component loading processing, and the front-end page document is scanned by the scanning engine to obtain the steps of multiple rendering components.
[0059] In the embodiment of the present application, based on the above embodiment, for the unloaded rendering component, the on-demand loading and use of the component module is realized through the use method of the module loading engine. The defined component name is passed into the use method, so that the module loading engine can load the corresponding component module resources on demand according to the passed component name for use when the scanning engine creates resources. When the component is loaded, the scanning function of the scanning engine will be automatically triggered. When an unloaded component is found during the automatic scanning process, the loading of the component module will be automatically triggered. For example, loading the input component.
[0060] The embodiment of the present application manages and loads all component modules, including unloaded rendering components, and uses an efficient automatic scanning engine to achieve rapid configuration and instant rendering of components, greatly accelerating the convenient use of components by businesses and getting rid of cumbersome JavaScript code writing. There is no need to manually trigger component creation and rendering, which significantly improves work efficiency and convenience.
[0061] In an exemplary embodiment, based on the above embodiment, see Figure 3 The embodiment of the present application relates to a process of rendering each rendering component according to pre-configured component properties and component constructors to obtain a rendering result, including the following S301 to S302. Among them:
[0062] S301, filtering the properties of each rendering component according to the component properties to obtain the target properties of each rendering component.
[0063] In an embodiment of the present application, based on the multiple rendering components obtained in the above embodiment, the terminal can compare the collected attributes with the attributes exposed by the component itself according to the component attributes, filter out the attributes that the component does not need, and obtain the target attributes of each rendering component.
[0064] S302, input each target attribute into the component constructor for rendering processing to obtain a rendering result.
[0065] In an embodiment of the present application, based on the target attributes and component construction functions obtained in the above embodiments, the terminal can input each target attribute into the component constructor for rendering processing. The specific process is: by obtaining the component tag of the rendering component, the component attributes to be rendered are obtained, the target attributes are filtered, and the pre-configured component attributes are obtained. The pre-configured component attributes are input into the component constructor for construction processing to achieve the effect of rendering processing of each rendering component, and the rendering results are displayed on the front-end page.
[0066] In the embodiment of the present application, by filtering the component attributes, unnecessary attributes of the component can be filtered out to achieve the expected page effect.
[0067] In an exemplary embodiment, based on the above embodiment, see Figure 4 The process of scanning and processing the front-end page document to obtain multiple rendering components in the embodiment of the present application includes the following S401 to S402. Among them:
[0068] S401, determining the area to be scanned in the front page document.
[0069] The purpose of scanning a page is to analyze the data-ui attributes on the page elements, collect the used component modules, and store the collected components for quick creation of rendering components. The scanning engine provides scanning methods for business use.
[0070] In the embodiment of the present application, the terminal can determine the area to be scanned in the front page document according to the scanning area parameters input by the backend personnel, or automatically obtain the unscanned area in the front page document as the area to be scanned.
[0071] S402, scanning the area to be scanned to obtain various rendering components.
[0072] In an embodiment of the present application, based on the area to be scanned obtained in the above embodiment, the terminal can control the scanning engine to scan the elements on the page, find the target elements, automatically create and render the components, and obtain various rendering components.
[0073] The embodiment of the present application helps the business to efficiently create and render components by scanning the creation engine, reduces the amount of business code development, and greatly facilitates the business's use of components.
[0074] In an exemplary embodiment, based on the above embodiment, the embodiment of the present application relates to a process of scanning an area to be scanned to obtain multiple rendering components, which specifically includes:
[0075] When the area to be scanned includes a local area, the page elements of the local area are scanned to obtain multiple rendering components. When the area to be scanned includes a global area, the page elements of the global area are scanned to obtain various rendering components.
[0076] Among them, the scanning page can be mainly divided into local scanning and global scanning.
[0077] In the embodiment of the present application, for partial scanning, by calling the scanning method and passing in a specified HTML fragment, automatic scanning within the fragment can be achieved. For example, only scanning the ul area will only collect components in the UL tag.
[0078] For global scanning, the scanning engine performs global scanning by default when performing automatic scanning, so that all component elements used by the page can be collected. By calling the scanning method without passing in any parameters, a global scan is also performed.
[0079] The embodiment of the present application performs a local or global scan on the page so that the scanning engine can automatically identify the unloaded components and then automatically load the corresponding component resources.
[0080] In an exemplary embodiment, based on the above embodiment, see Figure 5 The configuration process of the component attributes of the embodiment of the present application includes the following S501 to S502. Among them:
[0081] S501, obtaining a component name.
[0082] In the embodiment of the present application, the component name may be input by a backend staff or the terminal may determine the component name of the component according to the corresponding relationship of the acquired components.
[0083] S502, performing configuration processing on the attribute values of each attribute corresponding to the component name to obtain component attributes.
[0084] In the embodiment of the present application, the quick use of components is achieved by performing simple attribute configuration on the HTML template element of the page. By configuring the "data-ui" attribute on the HTML template element, the attribute value is the defined component name, and then configuring other required attributes of the component through "data-*", the use of the component can be achieved through these attribute configurations. For example, when using the input component, configure the width and value attributes of the input.
[0085] The embodiment of the present application obtains component attributes by configuring and processing the attribute values of each attribute corresponding to the component name, so that the subsequent scanning creation engine can help the business to achieve efficient creation and rendering of components.
[0086] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application further includes: defining a component through a module loading engine to obtain a component name and a component method body.
[0087] Among them, the component method body is used to indicate the rendering logic of the component.
[0088] In the embodiment of the present application, the definition of the component module is realized through the define method of the module loading engine. The component name and the method body of the component implementation are passed into the define method, and the define method is mainly used to realize that the component can be recognized and called by the module loading engine. The component name is mainly used to identify the current module. When called by the module loading engine, the corresponding component module can be accurately found. The component method body is mainly the specific rendering logic of the component module, which can be provided to the module loading engine for use, and can also be provided to the automatic scanning engine for use. When the component method body is called, the rendering of the component will be realized. For example, define the input form component.
[0089] In the embodiment of the present application, the component definition is performed through the module loading engine so that the terminal can quickly find the corresponding component name and component method body according to the acquired component, and when the component method body is called, the component rendering is quickly realized.
[0090] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application further includes the following steps:
[0091] Step 1: Define the component through the module loading engine to obtain the component name and component method body; obtain the component name; configure the attribute values of each attribute corresponding to the component name to obtain the component attributes;
[0092] Step 2: Determine the area to be scanned in the front-end page document; if the area to be scanned includes a local area, scan and process the page elements of the local area to obtain multiple rendering components; if the area to be scanned includes a global area, scan and process the page elements of the global area to obtain various rendering components;
[0093] Step 3: For the loaded rendering components, filter the properties of each rendering component according to the component properties to obtain the target properties of each rendering component; input each target property into the component constructor for rendering processing to obtain the rendering result;
[0094] Step 4: For the unloaded rendering components, the loading function is called by the module loading engine to load the components, and the front-end page document is scanned by the scanning engine to obtain multiple rendering components.
[0095] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0096] Based on the same inventive concept, the embodiment of the present application also provides a component rendering device for implementing the component rendering method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more component rendering device embodiments provided below can refer to the limitations of the component rendering method above, and will not be repeated here.
[0097] In one embodiment, Figure 6 As shown, a component rendering device 600 is provided, comprising:
[0098] The component determination module 601 is used to scan the front-end page document through a scanning engine to obtain multiple rendering components;
[0099] The component rendering module 602 is used to perform rendering processing on each loaded rendering component according to pre-configured component properties and component constructors to obtain a rendering result.
[0100] In one embodiment, the above device further comprises:
[0101] The component loading module is used to call the loading function through the module loading engine to load the unloaded rendering components, and execute the steps of scanning the front-end page document through the scanning engine to obtain multiple rendering components.
[0102] In one embodiment, the component rendering module includes:
[0103] An attribute determination unit, used to filter the attributes of each rendering component according to the component attributes to obtain the target attributes of each rendering component;
[0104] The component rendering unit is used to input each target attribute into the component constructor for rendering processing to obtain a rendering result.
[0105] In one embodiment, the component determination module includes:
[0106] An area determination unit, used to determine the area to be scanned in the front page document;
[0107] The scanning unit is used to scan the area to be scanned to obtain various rendering components.
[0108] In one embodiment, the scanning unit comprises:
[0109] A local scanning subunit, for scanning page elements in a local area to obtain a plurality of rendering components when the area to be scanned includes the local area;
[0110] The global scanning subunit is used to scan and process the page elements of the global area to obtain various rendering components when the area to be scanned includes the global area.
[0111] In one embodiment, the above device further comprises:
[0112] Name acquisition module, used to obtain component names;
[0113] The attribute configuration module is used to configure the attribute values of each attribute corresponding to the component name to obtain the component attributes.
[0114] In one embodiment, the above device further comprises:
[0115] The component definition module is used to define the component through the module loading engine to obtain the component name and component method body; wherein the component method body is used to indicate the rendering logic of the component.
[0116] Each module in the above component rendering device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0117] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a component rendering method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0118] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0119] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0120] The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components;
[0121] For the loaded rendering components, rendering processing is performed on each rendering component according to the pre-configured component properties and component constructor to obtain the rendering result.
[0122] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0123] For the unloaded rendering components, the loading function is called by the module loading engine to perform component loading processing, and the front-end page document is scanned by the scanning engine to obtain the steps of multiple rendering components.
[0124] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0125] Filter the properties of each rendering component according to the component properties to obtain the target properties of each rendering component;
[0126] Input each target attribute into the component constructor for rendering to obtain the rendering result.
[0127] In one embodiment, the front-end page document is scanned and processed to obtain multiple rendering components, including:
[0128] Determine the area to be scanned in the front-end page document;
[0129] The area to be scanned is scanned to obtain various rendering components.
[0130] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0131] When the area to be scanned includes a local area, scanning and processing are performed on page elements in the local area to obtain multiple rendering components;
[0132] When the area to be scanned includes the global area, the page elements of the global area are scanned to obtain various rendering components.
[0133] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0134] Get the component name;
[0135] The attribute values of each attribute corresponding to the component name are configured and processed to obtain the component attributes.
[0136] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0137] The component is defined through the module loading engine to obtain the component name and component method body; the component method body is used to indicate the rendering logic of the component.
[0138] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0139] The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components;
[0140] For the loaded rendering components, rendering processing is performed on each rendering component according to the pre-configured component properties and component constructor to obtain the rendering result.
[0141] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0142] For the unloaded rendering components, the loading function is called by the module loading engine to perform component loading processing, and the front-end page document is scanned by the scanning engine to obtain the steps of multiple rendering components.
[0143] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0144] Filter the properties of each rendering component according to the component properties to obtain the target properties of each rendering component;
[0145] Input each target attribute into the component constructor for rendering to obtain the rendering result.
[0146] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0147] Determine the area to be scanned in the front-end page document;
[0148] The area to be scanned is scanned to obtain various rendering components.
[0149] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0150] When the area to be scanned includes a local area, scanning and processing are performed on page elements in the local area to obtain multiple rendering components;
[0151] When the area to be scanned includes the global area, the page elements of the global area are scanned to obtain various rendering components.
[0152] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0153] Get the component name;
[0154] The attribute values of each attribute corresponding to the component name are configured and processed to obtain the component attributes.
[0155] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0156] The component is defined through the module loading engine to obtain the component name and component method body; the component method body is used to indicate the rendering logic of the component.
[0157] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0158] The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components;
[0159] For the loaded rendering components, rendering processing is performed on each rendering component according to the pre-configured component properties and component constructor to obtain the rendering result.
[0160] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0161] For the unloaded rendering components, the loading function is called by the module loading engine to perform component loading processing, and the front-end page document is scanned by the scanning engine to obtain the steps of multiple rendering components.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0163] Filter the properties of each rendering component according to the component properties to obtain the target properties of each rendering component;
[0164] Input each target attribute into the component constructor for rendering to obtain the rendering result.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] Determine the area to be scanned in the front-end page document;
[0167] The area to be scanned is scanned to obtain various rendering components.
[0168] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0169] When the area to be scanned includes a local area, scanning and processing are performed on page elements in the local area to obtain multiple rendering components;
[0170] When the area to be scanned includes the global area, the page elements of the global area are scanned to obtain various rendering components.
[0171] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0172] Get the component name;
[0173] The attribute values of each attribute corresponding to the component name are configured and processed to obtain the component attributes.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] The component is defined through the module loading engine to obtain the component name and component method body; the component method body is used to indicate the rendering logic of the component.
[0176] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0177] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0178] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0179] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A component rendering method, characterized in that: The method comprises: The front-end page document is scanned and processed by the scanning engine to obtain multiple rendering components; For the loaded rendering components, rendering processing is performed on each of the rendering components according to the pre-configured component properties and component constructors to obtain a rendering result.
2. The method according to claim 1, characterized in that The method further comprises: For the unloaded rendering components, the loading function is called by the module loading engine to perform component loading processing, and the steps of scanning the front-end page document by the scanning engine to obtain multiple rendering components are executed.
3. The method according to claim 1 or 2, characterized in that: The rendering process is performed on each of the rendering components according to the pre-configured component properties and component constructor to obtain a rendering result, including: Filtering the properties of each rendering component according to the component properties to obtain target properties of each rendering component; Each of the target attributes is input into the component constructor for rendering processing to obtain the rendering result.
4. The method according to claim 1, characterized in that: The front-end page document is scanned and processed to obtain multiple rendering components, including: Determine the area to be scanned in the front page document; The area to be scanned is scanned to obtain the rendering components.
5. The method according to claim 4, characterized in that The scanning process is performed on the area to be scanned to obtain multiple rendering components, including: In the case where the area to be scanned includes a local area, scanning and processing are performed on page elements of the local area to obtain a plurality of the rendering components; In the case that the area to be scanned includes a global area, the page elements of the global area are scanned to obtain the rendering components.
6. The method according to claim 3, characterized in that The configuration process of the component properties includes: Get the component name; The attribute values of the attributes corresponding to the component name are configured to obtain the component attributes.
7. The method according to claim 6, characterized in that The method further comprises: The component is defined through a module loading engine to obtain the component name and component method body; wherein the component method body is used to indicate the rendering logic of the component.
8. A component rendering device, characterized in that: The device comprises: The component determination module is used to scan and process the front-end page document through a scanning engine to obtain multiple rendering components; The component rendering module is used to render the loaded rendering components according to the pre-configured component properties and component constructors to obtain rendering results.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
