Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The embodiment of the application provides a page file conversion method which is applied to electronic equipment, and is shown in fig. 2, and the method comprises the following steps:
step 201, converting the obtained VUE file corresponding to the page to be processed into a first abstract syntax tree through a first conversion function.
The page to be processed is a page which needs editing processing in the front-end page.
The VUE file is a source code file of a page to be processed in a front-end page constructed by a VUE component, wherein the VUE component is an abstract unit for forming a page view.
The first conversion function is a conversion function in a JavaScript compiler. The first transformation function may be, for example, a @ vue/compiler-dom function in babel compiler.
The abstract syntax tree (Abstract Syntax Tree, AST) is used for abstractly expressing the logical relation of the syntax structure in the source code, and it should be noted that the abstract syntax tree is applicable to all types of programming languages.
In the embodiment of the application, the electronic equipment acquires a source code file corresponding to a page to be processed, namely a VUE file, and converts the VUE file into a first abstract syntax tree through a first conversion function such as a @ VUE/compiler-dom function in a babel compiler.
Step 202, obtaining partial content corresponding to each module in the first abstract syntax tree.
The system comprises a page structure module, a page logic module and a page style module.
In the embodiment of the application, under the condition that the electronic equipment converts the VUE file corresponding to the acquired page to be processed into the first abstract syntax tree through the first conversion function, traversing each tree node in the first abstract syntax tree, and determining partial content corresponding to each module according to the node label of the tree node.
In an application scenario that can be implemented, an electronic device obtains a node tag of a tree node in a first abstract syntax tree, and obtains the tag as content corresponding to a page structure module template, a page logic module script and a page style module style.
And 203, converting partial content corresponding to each module into a JSON page configuration file corresponding to the page to be processed according to the JavaScript object profile JSON page configuration of the visual editor, so that the visual editor processes the page to be processed in an editing preview area of the visual editor based on the JSON page configuration file.
The JSON page is configured as a configuration of the visual editor to the page according to own JSON specifications. JSON page configuration files are files that are suitable for use in a visual editor. Here, JSON, javaScript object notation (JavaScript Object Notation, JSON), is an open standard data exchange format based on JavaScript syntax subset. JSON is text-based, lightweight, and is generally considered easy to read/write.
In the embodiment of the application, after the electronic device acquires part of the content corresponding to each module in the first abstract syntax tree, the part of the content corresponding to each module is converted into the JSON page configuration file corresponding to the page to be processed according to the JSON page configuration of the visual editor, so that the visual editor processes the page to be processed in an editing preview area of the visual editor based on the JSON page configuration file.
In one possible application scenario, referring to fig. 3, after the page code file is edited by the visual editor 301, in the case that the business logic of the page is complex, the page code file 4 performs secondary page development through the local code integration development tool (INTEGRATED DEVELOPMENT ENVIRONMENT, IDE) 302, such as vscode tool, and further uploads the secondarily developed page code file to the project repository 303, such as the GIT repository. If the VUE file in the page code file uploaded to the GIT warehouse needs to be processed again, the VUE file can be previewed and edited again on the visual editor platform after being processed by the page file conversion method provided by the embodiment of the application, so that the page file developed by the local IDE tool can be realized, the page development efficiency can be improved, and the page development cost can be saved.
The page file conversion method provided by the embodiment of the application converts the obtained VUE file corresponding to the page to be processed into a first abstract syntax tree through a first conversion function, obtains partial contents corresponding to each module in the first abstract syntax tree, converts the partial contents corresponding to each module into a JSON page configuration file corresponding to the page to be processed according to the JSON page configuration of a visual editor, so that the visual editor processes the page to be processed in an editing preview area of the visual editor based on the JSON page configuration file, thus solving the problem that the page code file subjected to secondary development in the related art cannot be previewed and edited again in a visual editor platform, realizing the page file developed through a local IDE tool, and also being capable of carrying out secondary editing in the visual editor, improving the page development efficiency and saving the page development cost.
The embodiment of the application provides a page file conversion method which is applied to electronic equipment, and is shown in fig. 4, and the method comprises the following steps:
Step 401, converting the obtained VUE file corresponding to the page to be processed into a first abstract syntax tree through a first conversion function.
Step 402, obtaining partial content corresponding to each module in the first abstract syntax tree.
The partial contents corresponding to the modules comprise a first partial content corresponding to the page structure module, a second partial content corresponding to the page logic module and a third partial content corresponding to the page style module.
Step 403, converting the first part of content corresponding to the page structure module in the first abstract syntax tree according to the page structure configuration in the JSON page configuration, to obtain a JSON page structure configuration file.
In the embodiment of the present application, referring to fig. 5, step 403 converts, according to the page structure configuration in the JSON page configuration, a first portion of content corresponding to a page structure module in a first abstract syntax tree, to obtain a JSON page structure configuration file, which may be implemented by the following steps:
step 4031, converting the first portion of content into a second abstract syntax tree by a second conversion function.
The first conversion function is a conversion function in the JavaScript compiler, and the second conversion function is different from the first conversion function. The second transformation function may be, for example, a vue-template-compiler function in babel compiler. Wherein the second abstract syntax tree is different from the first abstract syntax tree.
Here, the second abstract syntax tree is a tree representation of an abstract syntax structure of the source code in the VUE file for describing logical relations between statements of the source code, each node on the tree representing a structure in the source code, each tree node corresponding to a source code item. FIG. 6 is a schematic diagram of a second abstract syntax tree corresponding to source code in a VUE file according to an embodiment of the present application:
In the embodiment of the present application, the electronic device converts the first portion of content corresponding to the page structure module, for example, the template module, into the second abstract syntax tree through the second conversion function, for example, the vue-template-compiler function in the babel compiler.
Step 4032, traversing each node in the second abstract syntax tree by taking the root node in the second abstract syntax tree as a starting point according to the layer sequence traversing order, and obtaining the first node identifier and the first node attribute of each node.
Wherein the nodes in the second abstract syntax tree comprise root nodes.
In the embodiment of the application, after the electronic device converts the first part of content into the second abstract syntax tree through the second conversion function, determining a root node in the second abstract syntax tree, traversing each node in the second abstract syntax tree by taking the root node as a starting point according to the traversing sequence of the layer sequence, and acquiring a first node identifier and a first node attribute of each node. And then, saving the first node identification and the first node attribute into the JSON object.
Step 4033, generating a JSON page structure configuration file based on the first node identification of each node, the first node attribute of each node, and the page structure configuration.
In the embodiment of the present application, step 4033 generates a JSON page structure configuration file based on the first node identifier of each node, the first node attribute of each node, and the page structure configuration, where two implementation cases exist:
In the first case, if the node in the second abstract syntax tree does not have a child node, generating a JSON page structure configuration file based on the association relation among the nodes in the second abstract syntax tree, the first node identifier of each node, the first node attribute of each node and the page structure configuration.
In the embodiment of the present application, the association relationship between the nodes is a logical relationship between the nodes in the second abstract syntax tree, and exemplary logical relationships between the nodes include, but are not limited to, sibling relationships between the nodes, parent-child relationships between the nodes, and the like.
In the embodiment of the application, the electronic equipment judges whether a node in the second abstract syntax tree has a child node, and if the node is determined to have no child node, a JSON page structure configuration file is generated based on the association relation among the nodes in the second abstract syntax tree, the first node identification of each node, the first node attribute of each node and the page structure configuration.
In the second case, if the node in the second abstract syntax tree has a child node, traversing all the child nodes in the node according to a recursive traversal algorithm, and acquiring a second node identifier and a second node attribute of the child node of each node;
And generating a JSON page structure configuration file based on the association relation between the nodes and the child nodes in the second abstract syntax tree, the first node identification and the first node attribute of each node, the second node identification and the second node attribute of the child node of each node and page structure configuration.
In the embodiment of the application, the electronic equipment judges whether the node in the second abstract syntax tree has the child node, if the node is determined to have the child node, all the child nodes in the node are traversed according to a recursion traversal algorithm, and the second node identification and the second node attribute of the child node of each node are obtained. And then, saving the second node identification and the second node attribute of the child node into the child array of the JSON object. Further, the electronic device outputs a JSON page structure configuration file of the second abstract node tree of the first partial content corresponding to the page structure module based on the association relationship between the nodes and the child nodes in the second abstract syntax tree, based on the first node identifier and the first node attribute of each node, based on the second node identifier and the second node attribute of the child node of each node, and based on the page structure configuration. Here, the JSON page structure configuration file includes a root node and a branch node of the second abstract node tree, and the description information of each node includes a first node identifier, a first node attribute, and description information of a child node.
In an application scenario which can be realized, if a source code in a VUE file is the code provided by the method, electronic equipment firstly converts a first part of content corresponding to a template module into a second abstract syntax tree through a second conversion function, secondly traverses each node in the second abstract syntax tree by taking a root node in the second abstract syntax tree as a starting point according to a layer sequence traversing sequence to obtain a first node identifier and a first node attribute of each node, secondly, the electronic equipment judges whether the node in the second abstract syntax tree has a child node or not, if the node has the child node, traverses all the child nodes in the node according to a recursion traversing algorithm to obtain a second node identifier and a second node attribute of the child node of each node, and finally generates a JSON page structure configuration file based on the first node identifier of each node, the first node attribute of each node and page structure configuration. Here, part of the code in the generated JSON page structure configuration file is as follows:
it should be noted that, the code shown above is an exemplary partial code in the JSON page structure configuration file, and not all the codes are shown, so there is an incomplete place in the code structure.
And step 404, converting the second part of content corresponding to the page logic module in the first abstract syntax tree according to the page logic configuration in the JSON page configuration to obtain a JSON page logic configuration file.
In the embodiment of the present application, referring to fig. 7, step 404 converts, according to the page logic configuration in the JSON page configuration, the second portion of content corresponding to the page logic module in the first abstract syntax tree, to obtain a JSON page logic configuration file, which may be implemented by the following steps:
and 4041, converting the second sub-part content in the second part content based on the object conversion function to obtain the JavaScript object.
The second sub-portion content is content included in export default in the second portion content corresponding to the page logic module, for example, script.
Wherein the object transformation function is used to transform the character string into an object type. The object transformation function may be an eval function in JavaScript functions, for example.
In the embodiment of the application, the electronic device obtains the second sub-part content in the second part content corresponding to the page logic module, such as the script, and converts the second sub-part content based on the object conversion function to obtain the JavaScript object, which is abbreviated as JS object.
Step 4042, obtaining field content corresponding to the multiple field identifiers in the JavaScript object.
In an embodiment of the present application, the plurality of fields may include, but are not limited to, name, data, attribute props, calculated attribute computer, instance methods, and VUE lifecycle of the VUE instance in the VUE file.
In the embodiment of the application, the electronic device converts the second sub-part content in the second part content based on the object conversion function, and obtains the field content corresponding to the plurality of field identifiers in the JS object after obtaining the JS object, that is, the electronic device reads the field content corresponding to the field identifier by formulating the field identifier so as to map the field content to the target field identifier with the mapping relation with the field identifier.
Step 4043, determining the target field identifier with a mapping relation with the field identifier in the page logic configuration based on the field mapping table.
In the embodiment of the application, after acquiring field contents corresponding to a plurality of field identifications in a JavaScript object, the electronic device acquires a field mapping table, and determines a target field identification with a mapping relation with the field identification in page logic configuration based on the field mapping table, wherein part of the field mapping table is shown in table 1.
TABLE 1
It should be noted that, the code corresponding to the target field identifier LIFECYCLE in the page logic configuration is as follows:
'_constructor':'created',
'getDerivedStateFromProps':'beforeUpdate',
'render':”,
'componentDidMount':'mounted',
'componentDidUpdate':'updated',
'componentWillUnmount':'beforeDestroy'
step 4044, writing the field content into the field corresponding to the target field identifier to obtain the JSON page logic configuration file.
In the embodiment of the application, after determining the target field identifier with the mapping relation with the field identifier in the page logic configuration based on the field mapping table, the electronic device writes the field content into the field corresponding to the target field identifier to determine the field content corresponding to the target field identifier, thereby obtaining the JSON page logic configuration file.
And 405, converting a third part of content corresponding to the page style module in the first abstract syntax tree according to the page style configuration in the JSON page configuration to obtain a JSON page style configuration file.
In the embodiment of the present application, referring to fig. 8, step 405 converts a third portion of content corresponding to a page style module in a first abstract syntax tree according to a page style configuration in JSON page configuration, to obtain a JSON page style configuration file, which may be implemented by the following steps:
Step 4051, obtaining the class identifier in the third portion of content.
Step 4052, obtaining the target node corresponding to the class identifier in the JSON page structure configuration file.
And 4053, adding the style content in the third part of content into the page style field in the target node to obtain the JSON page style configuration file.
In an application scenario that can be implemented, the electronic device obtains a class identifier corresponding to a third portion of content corresponding to a page style module, searches a generated JSON page structure configuration file for a target node whose identifier is the same as the class identifier in a class identifier or class name in a class props field, and supplements a style content increment in the third portion of content to a page style field in the target node in the JSON page structure configuration file, so as to obtain the JSON page style configuration file.
And 406, generating a JSON page configuration file based on the JSON page structure configuration file, the JSON page logic configuration file and the JSON page style configuration file, so that the visual editor processes the page to be processed in an editing preview area of the visual editor based on the JSON page configuration file.
According to the method and the device, firstly, the VUE file corresponding to the page to be processed is obtained and converted into a first abstract syntax tree through a first conversion function, secondly, first partial content corresponding to the page structure module, second partial content corresponding to the page logic module and third partial content corresponding to the page style module in the first abstract syntax tree are determined based on the tag, and secondly, the first partial content corresponding to the page structure module, the second partial content corresponding to the page logic module and the third partial content corresponding to the page style module are respectively identified through the corresponding conversion module and then mapped into the JSON file corresponding to the page configuration of the electronic device, so that source codes in the VUE file of the page are finally converted into the JSON page configuration file, and the method and the device realize inverse editing in a development flow without changing the original page through a self-defined conversion mode, namely, perform secondary editing in a visual editor, improve page development efficiency and save page development cost.
It should be noted that, in this embodiment, the descriptions of the same steps and the same content as those in other embodiments may refer to the descriptions in other embodiments, and are not repeated here.
An embodiment of the present application provides a device for converting a page file, which may be applied to a method for converting a page file provided in the embodiments corresponding to fig. 2, 4to 5, and 7 to 8, and referring to fig. 9, the device 9 for converting a page file includes:
The first conversion module 901 is configured to convert the VUE file corresponding to the acquired page to be processed into a first abstract syntax tree through a first conversion function;
an obtaining module 902, configured to obtain partial content corresponding to each module in the first abstract syntax tree;
the second conversion module 903 is configured to convert, according to the JSON page configuration of the JavaScript object profile of the visual editor, part of the content corresponding to each module into a JSON page configuration file corresponding to the page to be processed, so that the visual editor processes the page to be processed in an editing preview area of the visual editor based on the JSON page configuration file.
In other embodiments of the present application, the second transformation module 903 is further configured to transform, according to a page structure configuration in the JSON page configuration, a first portion of content corresponding to a page structure module in the first abstract syntax tree to obtain a JSON page structure configuration file, transform, according to a page logic configuration in the JSON page configuration, a second portion of content corresponding to a page logic module in the first abstract syntax tree to obtain a JSON page logic configuration file, transform, according to a page style configuration in the JSON page configuration, a third portion of content corresponding to a page style module in the first abstract syntax tree to obtain a JSON page style configuration file, and generate a JSON page configuration file based on the JSON page structure configuration file, the JSON page logic configuration file, and the JSON page style configuration file.
In other embodiments of the present application, the second transformation module 903 is further configured to transform the first portion of content into a second abstract syntax tree through a second transformation function, the obtaining module 902 is further configured to traverse each node in the second abstract syntax tree with a root node in the second abstract syntax tree as a starting point according to a layer sequence traversing order, obtain a first node identifier and a first node attribute of each node, where a node in the second abstract syntax tree includes a root node, and the generating module is further configured to generate a JSON page structure configuration file based on the first node identifier of each node, the first node attribute of each node, and the page structure configuration.
In other embodiments of the present application, the generating module is further configured to generate a JSON page structure configuration file based on the association relationship between the nodes in the second abstract syntax tree, the first node identifier of each node, the first node attribute of each node, and the page structure configuration if the node in the second abstract syntax tree does not have a child node.
In other embodiments of the present application, the obtaining module 902 is further configured to traverse all the children nodes in the node according to a recursive traversal algorithm if the children nodes exist in the node in the second abstract syntax tree, obtain a second node identifier and a second node attribute of the children node of each node, and the generating module is further configured to generate a JSON page structure configuration file based on an association relationship between the nodes in the second abstract syntax tree and the children nodes, based on the first node identifier and the first node attribute of each node, based on the second node identifier and the second node attribute of the children node of each node, and based on page structure configuration.
In other embodiments of the present application, the second conversion module 903 is further configured to convert a second sub-portion of content in the second portion of content based on an object conversion function to obtain a JavaScript object, the obtaining module 902 is further configured to obtain field contents corresponding to a plurality of field identifiers in the JavaScript object, the generating module is further configured to determine, based on a field mapping table, a target field identifier having a mapping relationship with the field identifier in the page logic configuration, and write the field contents into a field corresponding to the target field identifier to obtain a JSON page logic configuration file.
In other embodiments of the present application, the obtaining module 902 is further configured to obtain a class identifier in the third portion of content, obtain a target node corresponding to the class identifier in the JSON page structure configuration file, and the generating module is further configured to add style content in the third portion of content to a page style field in the target node, so as to obtain the JSON page style configuration file.
An embodiment of the present application provides an electronic device, which may be applied to a method for converting a page file provided in the embodiments corresponding to fig. 2, 4 to 5, and 7 to 8, and referring to fig. 10, the electronic device (the electronic device 10 in fig. 10 corresponds to the page file converting apparatus 9 in fig. 9) includes a processor 1001, a memory 1002, and a communication bus 1003, where:
A communication bus 1003 is used to enable communication connections between the processor 1001 and the memory 1002;
the processor 1001 is configured to execute a page file conversion program stored in the memory 1002 to implement the steps of:
Converting the VUE file corresponding to the acquired page to be processed into a first abstract syntax tree through a first conversion function;
Acquiring partial content corresponding to each module in a first abstract syntax tree;
According to the JavaScript object profile JSON page configuration of the visual editor, converting part of the content corresponding to each module into a JSON page configuration file corresponding to the page to be processed, so that the visual editor processes the page to be processed in an editing preview area of the visual editor based on the JSON page configuration file.
In other embodiments of the present application, the processor 1001 is configured to execute a pagefile conversion program stored in the memory 1002 to implement the following steps:
Converting a first part of content corresponding to a page structure module in a first abstract syntax tree according to page structure configuration in the JSON page configuration to obtain a JSON page structure configuration file, converting a second part of content corresponding to the page logic module in the first abstract syntax tree according to page logic configuration in the JSON page configuration to obtain a JSON page logic configuration file, converting a third part of content corresponding to a page style module in the first abstract syntax tree according to page style configuration in the JSON page configuration to obtain a JSON page style configuration file, and generating the JSON page configuration file based on the JSON page structure configuration file, the JSON page logic configuration file and the JSON page style configuration file.
In other embodiments of the present application, the processor 1001 is configured to execute a pagefile conversion program stored in the memory 1002 to implement the following steps:
the method comprises the steps of converting a first part of content into a second abstract syntax tree through a second conversion function, traversing each node in the second abstract syntax tree by taking a root node in the second abstract syntax tree as a starting point according to a layer sequence traversing sequence to obtain a first node identifier and a first node attribute of each node, and generating a JSON page structure configuration file based on the first node identifier of each node, the first node attribute of each node and page structure configuration.
In other embodiments of the present application, the processor 1001 is configured to execute a pagefile conversion program stored in the memory 1002 to implement the following steps:
if the nodes in the second abstract syntax tree do not have child nodes, generating a JSON page structure configuration file based on the association relation among the nodes in the second abstract syntax tree, the first node identification of each node, the first node attribute of each node and the page structure configuration.
In other embodiments of the present application, the processor 1001 is configured to execute a pagefile conversion program stored in the memory 1002 to implement the following steps:
And generating a JSON page structure configuration file based on the association relation between the nodes in the second abstract syntax tree and the sub-nodes, based on the first node identification and the first node attribute of each node, the second node identification and the second node attribute of the sub-nodes of each node and page structure configuration.
In other embodiments of the present application, the processor 1001 is configured to execute a pagefile conversion program stored in the memory 1002 to implement the following steps:
Converting the second sub-part content in the second part content based on the object conversion function to obtain a JavaScript object, obtaining field content corresponding to a plurality of field identifications in the JavaScript object, determining a target field identification with a mapping relation with the field identifications in page logic configuration based on a field mapping table, and writing the field content into a field corresponding to the target field identification to obtain the JSON page logic configuration file.
In other embodiments of the present application, the processor 1001 is configured to execute a pagefile conversion program stored in the memory 1002 to implement the following steps:
the method comprises the steps of obtaining class identification in a third part of content, obtaining a target node corresponding to the class identification in a JSON page structure configuration file, and adding style content in the third part of content into a page style field in the target node to obtain the JSON page style configuration file.
Embodiments of the present application provide a computer storage medium storing one or more programs executable by one or more processors to implement the steps of:
Converting the VUE file corresponding to the acquired page to be processed into a first abstract syntax tree through a first conversion function;
Acquiring partial content corresponding to each module in a first abstract syntax tree;
According to the JavaScript object profile JSON page configuration of the visual editor, converting part of the content corresponding to each module into a JSON page configuration file corresponding to the page to be processed, so that the visual editor processes the page to be processed in an editing preview area of the visual editor based on the JSON page configuration file.
In other embodiments of the application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:
Converting a first part of content corresponding to a page structure module in a first abstract syntax tree according to page structure configuration in the JSON page configuration to obtain a JSON page structure configuration file, converting a second part of content corresponding to the page logic module in the first abstract syntax tree according to page logic configuration in the JSON page configuration to obtain a JSON page logic configuration file, converting a third part of content corresponding to a page style module in the first abstract syntax tree according to page style configuration in the JSON page configuration to obtain a JSON page style configuration file, and generating the JSON page configuration file based on the JSON page structure configuration file, the JSON page logic configuration file and the JSON page style configuration file.
In other embodiments of the application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:
the method comprises the steps of converting a first part of content into a second abstract syntax tree through a second conversion function, traversing each node in the second abstract syntax tree by taking a root node in the second abstract syntax tree as a starting point according to a layer sequence traversing sequence to obtain a first node identifier and a first node attribute of each node, and generating a JSON page structure configuration file based on the first node identifier of each node, the first node attribute of each node and page structure configuration.
In other embodiments of the application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:
if the nodes in the second abstract syntax tree do not have child nodes, generating a JSON page structure configuration file based on the association relation among the nodes in the second abstract syntax tree, the first node identification of each node, the first node attribute of each node and the page structure configuration.
In other embodiments of the application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:
And generating a JSON page structure configuration file based on the association relation between the nodes in the second abstract syntax tree and the sub-nodes, based on the first node identification and the first node attribute of each node, the second node identification and the second node attribute of the sub-nodes of each node and page structure configuration.
In other embodiments of the application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:
Converting the second sub-part content in the second part content based on the object conversion function to obtain a JavaScript object, obtaining field content corresponding to a plurality of field identifications in the JavaScript object, determining a target field identification with a mapping relation with the field identifications in page logic configuration based on a field mapping table, and writing the field content into a field corresponding to the target field identification to obtain the JSON page logic configuration file.
In other embodiments of the application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented:
the method comprises the steps of obtaining class identification in a third part of content, obtaining a target node corresponding to the class identification in a JSON page structure configuration file, and adding style content in the third part of content into a page style field in the target node to obtain the JSON page style configuration file.
It should be noted here that the description of the storage medium and the device embodiments above is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the apparatus of the present application, please refer to the description of the method embodiments of the present application.
The computer storage medium/Memory may be a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable programmable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable programmable Read Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), a magnetic random access Memory (Ferromagnetic Random Access Memory, FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a compact disk Read Only Memory (Compact Disc Read-Only Memory, CD-ROM), or any combination thereof, and may be any terminal including one or more of the above, such as a mobile phone, a computer, a tablet device, a personal digital assistant, or the like.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment of the present application" or "the foregoing embodiments" or "some implementations" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "an embodiment of the application" or "the foregoing embodiment" or "some embodiments" or "some implementations" in various places throughout this specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application. The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, e.g., the division of elements is merely a logical division of functionality, and may be implemented in other manners, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate components may or may not be physically separate, and components displayed as units may or may not be physical units, may be located in one place or distributed on a plurality of network units, and may select some or all of the units according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of hardware plus a form of software functional unit.
The methods disclosed in the method embodiments provided by the application can be arbitrarily combined under the condition of no conflict to obtain a new method embodiment.
The features disclosed in the several product embodiments provided by the application can be combined arbitrarily under the condition of no conflict to obtain new product embodiments.
The features disclosed in the embodiments of the method or the apparatus provided by the application can be arbitrarily combined without conflict to obtain new embodiments of the method or the apparatus.
It will be appreciated by those of ordinary skill in the art that implementing all or part of the steps of the above method embodiments may be implemented by hardware associated with program instructions, where the above program may be stored in a computer readable storage medium, where the program when executed performs the steps comprising the above method embodiments, where the above storage medium includes various media that may store program code, such as a removable storage device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Or the above-described integrated units of the application may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or part of what contributes to the related art may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of the embodiments of the present application. The storage medium includes various media capable of storing program codes such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
It should be noted that the drawings in the embodiments of the present application are only for illustrating schematic positions of respective devices on the terminal device, and do not represent actual positions in the terminal device, the actual positions of respective devices or respective areas may be changed or shifted according to actual situations (for example, structures of the terminal device), and proportions of different parts in the terminal device in the drawings do not represent actual proportions.
The foregoing is merely an embodiment of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.