CN-121980106-A - Page editing method, device, equipment and readable storage medium
Abstract
The application discloses a page editing method, a device, equipment and a readable storage medium, wherein the method comprises the steps of determining a component structure body formed by at least one component object on an editing interface, and acquiring first description information of the component object, wherein the first description information comprises type information of the component object and configuration parameters associated with the type information; analyzing the component structure body based on the first description information to generate compilable information corresponding to the component structure body, wherein the compilable information comprises unique identification information generated for the component structure body; and executing the compilable information in the target virtual running environment, so that the nodes for describing the component structure bodies in the generated structured document of the target page carry unique identification information. The application analyzes the component into the universal compilable object based on the description information of the component, realizes the compatibility of the component and the front end, and indicates the subsequent interaction behavior on the page by adding the unique identification information of the component.
Inventors
- WANG TAO
Assignees
- 杭州网易智企科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251224
Claims (10)
- 1. A page editing method, comprising: Determining a component structure body formed by at least one component object on an editing interface, and acquiring first description information of each component object, wherein the first description information comprises type information of the component object and configuration parameters associated with the type information; Analyzing the component structure body based on the first description information to generate compilable information corresponding to the component structure body, wherein the compilable information comprises unique identification information generated for the component structure body; And executing the compilable information in the target virtual running environment, so that the unique identification information is carried by the nodes used for describing the component structure in the generated structural document of the target page.
- 2. The method of claim 1, wherein parsing the component structure based on the first description information generates compilable information corresponding to the component structure, comprising: Determining second description information of the component structure body, and generating tree structure data of the component structure body according to the first description information and the second description information, wherein the second description information comprises attribute information for indicating a display style of the component object on a page; analyzing the tree structure data based on the analysis rule corresponding to the first description information to obtain general description information corresponding to the component structure body, and generating unique identification information for the component structure body; The general description information is converted into compilable information under a target framework, so that the compilable information contains unique identification information of the component structure.
- 3. The method according to claim 2, wherein in the case where the component structure includes a plurality of component objects, the second description information further includes nesting information for indicating nesting relationships between component objects in the component structure; the compilable information comprises nesting identification information for indicating the nesting relationship.
- 4. A method according to any one of claims 1 to 3, further comprising: In response to detecting a touch operation acting on the target page, determining a target component structure picked up by the touch operation based on the unique identification information to generate a corresponding trigger event.
- 5. The method of claim 4, wherein the determining, in response to detecting a touch operation on the target page, a target component structure picked up by the touch operation based on the unique identification information comprises: in response to detection of touch operation acting on the target page, determining a target position indicated by the touch operation, and acquiring an element set covering the target position; And traversing the node of each element in the element set from top to bottom in turn based on the relation between the node of each element in the element set and the view port until a first target element with the node containing unique identification information is obtained, and taking the first target element as a target component structure body picked up by the touch operation.
- 6. The method of claim 5, wherein traversing the node of each element in the set of elements from top to bottom in turn until a first target element is obtained that includes unique identification information for the node, comprises: Traversing the nodes of each element in the element set from the top layer to the bottom layer in sequence, and judging whether the currently traversed target node comprises the node traversed last time; Determining that the touch operation does not have a picked-up target component structure body under the condition that the target node does not contain the node traversed last time; and under the condition that the target node comprises the last traversed node, continuing to traverse the nodes of the rest elements in the element set until a first target element of which the node comprises the unique identification information is obtained.
- 7. The method of claim 5, wherein the method further comprises: Traversing nodes of each element in the element set from top to bottom in turn until a second target element containing nested identification information is obtained, and And determining a third target element with the node containing unique identification information in the father element set of the second target element, and taking the third target element as a target component structure body picked up by the touch operation.
- 8. A page editing apparatus, comprising: The system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is used for determining a component structure body formed by at least one component object on an editing interface and acquiring first description information of each component object, and the first description information comprises type information of the component object and configuration parameters associated with the type information; the analysis module is used for analyzing the component structure body based on the first description information and generating compilable information corresponding to the component structure body, wherein the compilable information comprises unique identification information generated for the component structure body; And the generation module is used for executing the compilable information in the target virtual running environment, so that the unique identification information is carried by the nodes for describing the component structure in the generated structured document of the target page.
- 9. A computer device, the computer device comprising: One or more processors; memory, and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the page editing method of any of claims 1 to 7.
- 10. A computer-readable storage medium, having stored thereon a computer program, the computer program being loaded by a processor to perform the page editing method of any of claims 1 to 7.
Description
Page editing method, device, equipment and readable storage medium Technical Field The present application relates to the field of page design technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for editing a page. Background In a low code scenario, a user may build a page by dragging the front end component using a page designer. However, the front end of the current webpage is mostly developed based on component libraries on different frameworks, different business parties have different component libraries, and the component libraries are also realized based on different front end frameworks, so that incompatible components are often not identified when the front end is accessed, and different designers are developed for different component libraries, so that the maintenance cost is high and the access cost is high. Disclosure of Invention The application provides a page editing method, a page editing device, page editing equipment and a readable storage medium, which can realize the compatibility of a component library and a front end, so that the technical problems are at least partially solved. In a first aspect, a page editing method is provided, including: Determining a component structure body formed by at least one component object on an editing interface, and acquiring first description information of each component object, wherein the first description information comprises type information of the component object and configuration parameters associated with the type information; Analyzing the component structure body based on the first description information to generate compilable information corresponding to the component structure body, wherein the compilable information comprises unique identification information generated for the component structure body; And executing the compilable information in the target virtual running environment, so that the unique identification information is carried by the nodes used for describing the component structure in the generated structural document of the target page. In one embodiment of the present application, the parsing the component structure based on the first description information generates compilable information corresponding to the component structure, including: Determining second description information of the component structure body, and generating tree structure data of the component structure body according to the first description information and the second description information, wherein the second description information comprises attribute information for indicating a display style of the component object on a page; analyzing the tree structure data based on the analysis rule corresponding to the first description information to obtain general description information corresponding to the component structure body, and generating unique identification information for the component structure body; The general description information is converted into compilable information under a target framework, so that the compilable information contains unique identification information of the component structure. In one embodiment of the present application, in the case that the component structure includes a plurality of component objects, the second description information further includes nesting information for indicating nesting relationships between the component objects in the component structure; the compilable information comprises nesting identification information for indicating the nesting relationship. In one embodiment of the application, the method further comprises: In response to detecting a touch operation acting on the target page, determining a target component structure picked up by the touch operation based on the unique identification information to generate a corresponding trigger event. In one embodiment of the present application, in response to detecting a touch operation acting on the target page, determining a target component structure picked up by the touch operation based on the unique identification information includes: in response to detection of touch operation acting on the target page, determining a target position indicated by the touch operation, and acquiring an element set covering the target position; And traversing the node of each element in the element set from top to bottom in turn based on the relation between the node of each element in the element set and the view port until a first target element with the node containing unique identification information is obtained, and taking the first target element as a target component structure body picked up by the touch operation. In one embodiment of the present application, traversing the node of each element in the element set from top to bottom in turn until a first target element is obtained, where the node contains unique identification information, includes: Traversing the nodes of each element in