Nothing Special   »   [go: up one dir, main page]

CN116150527A - Component style isolation method, device, equipment, storage medium and product - Google Patents

Component style isolation method, device, equipment, storage medium and product Download PDF

Info

Publication number
CN116150527A
CN116150527A CN202310184743.8A CN202310184743A CN116150527A CN 116150527 A CN116150527 A CN 116150527A CN 202310184743 A CN202310184743 A CN 202310184743A CN 116150527 A CN116150527 A CN 116150527A
Authority
CN
China
Prior art keywords
component
file
path information
style
dependent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310184743.8A
Other languages
Chinese (zh)
Inventor
孟繁贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310184743.8A priority Critical patent/CN116150527A/en
Publication of CN116150527A publication Critical patent/CN116150527A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a component style isolation method, device, equipment, storage medium and product, which are applied to the technical field of software development, the technical field of finance and technology or the technical field of information. The method comprises the following steps: acquiring absolute path information of a target program dependent component; acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component to acquire an updated component structure file of the dependent component; and acquiring a component pattern file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of the corresponding component in a pattern selector in the component pattern file of the dependent component to acquire an updated component pattern file of the dependent component. Isolation of component styles may be achieved by adding component identifications in class attributes in the component structure file and adding component identifications in style selectors in the component style file.

Description

Component style isolation method, device, equipment, storage medium and product
Technical Field
The present disclosure relates to the field of software development, financial technology, or information technology, and in particular, to a method, apparatus, device, storage medium, and product for isolating a component style.
Background
The applet is an application which can be used without downloading and installing, can be conveniently acquired and spread in each host App, and has excellent user experience.
An applet is typically a multi-page application that a developer can abstract functional modules within a page into custom components for reuse in different pages. However, if the component styles are not isolated, after the applet page introduces a component, the page styles may be contaminated by the component styles or the component styles may be rendered by the page styles.
Disclosure of Invention
The application provides a component style isolation method, device, equipment, storage medium and product, which are used for solving the problem that after an applet page is introduced into a component, the page style is possibly polluted by the component style or the component style is polluted by the page style.
In a first aspect, the present application provides a component style isolation method, including: acquiring absolute path information of a target program dependent component;
Acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component to acquire an updated component structure file of the dependent component;
and acquiring a component pattern file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a pattern selector in the component pattern file of the dependent component to acquire an updated component pattern file of the dependent component.
Optionally, the target program dependent component includes: the global registration component, the obtaining the absolute path information of the target program dependent component includes:
acquiring target program data in a compiling state; and acquiring the global public configuration file of the target program from the target program data in the compiling state, and acquiring the absolute path information of the global registration component from the global public configuration file of the target program.
Optionally, the object dependent component further includes: the page registration component, which obtains the absolute path information of the target program dependent component, further includes:
acquiring page path information of a target program from the global public configuration file of the target program; acquiring a page configuration file of a target program page according to the page path information of the target program, and acquiring relative path information of a page registration component corresponding to each page from the page configuration file; and determining the absolute path information of the page registration component according to the page path information and the relative path information of the corresponding page registration component.
Optionally, the object dependent component further includes: the component registration component, which obtains the absolute path information of the target program dependent component, further includes:
adding the absolute path information of the global registration component and the absolute path information of the page registration component into a component path information array; acquiring component configuration files of a global registration component and a page registration component according to absolute path information in the component path information array, and acquiring relative path information of the component registration component from the component configuration files of the global registration component and the page registration component; and determining the absolute path information of the component registration component according to the absolute path information in the component path information array and the relative path information of the corresponding component registration component.
Optionally, the obtaining the component structure file of the dependent component according to the absolute path information of the dependent component includes:
adding the absolute path information of the component registration component into a component path information array; and obtaining the component structure file of the dependent component by adding the structure file suffix after the absolute path information of the global registration component, the absolute path information of the page registration component and the absolute path information of the component registration component in the component path information array.
The obtaining the component style file of the dependent component according to the absolute path information of the dependent component comprises the following steps:
and obtaining the component style file of the dependent component by adding the suffix of the style file after the absolute path information of the global registration component, the absolute path information of the page registration component and the absolute path information of the component registration component in the component path information array.
Optionally, adding the component identifier of the corresponding component in the class attribute in the component structure file of the dependent component to obtain the updated component structure file of the dependent component, including:
analyzing the component structure file into a component structure abstract syntax tree; if the fact that the class attribute does not exist in the root node in the component structure abstract syntax tree is determined, adding the class attribute to the root node, and determining the value of the class attribute as a component identifier of a corresponding component; if the class attribute exists in the root node in the component structure abstract syntax tree, adding a component identifier of a corresponding component after the value of the class attribute to update the value of the class attribute in the component structure abstract syntax tree; and converting the updated component structure abstract syntax tree into a structure file to obtain the component structure file of the updated dependent component.
Optionally, if it is determined that the class attribute exists in the root node in the abstract syntax tree of the component structure, adding the component identifier of the corresponding component after the value of the class attribute to update the value of the class attribute includes:
if the fact that the class attribute exists in the root node in the component structure abstract syntax tree is determined, determining the value of the class attribute as root node style information, and adding a component identifier of a corresponding component after the value of the class attribute to update the value of the class attribute.
Adding the component identifier of the corresponding component in the style selector in the component style file of the dependent component to obtain the updated component style file of the dependent component, including:
analyzing the component style file into a component style abstract syntax tree, and acquiring a style selector in the component style abstract syntax tree; if the element in the style selector is determined to comprise the root node style information, adding a component identifier of a corresponding component after the root node style information in the element so as to update the style selector in the component style abstract syntax tree; if the element in the style selector does not comprise the root node style information, adding a component identifier of a corresponding component before the element so as to update the style selector in the component style abstract syntax tree; and converting the updated component style abstract syntax tree into a style file to obtain an updated style structure file of the dependent component.
Optionally, acquiring the component structure file of the updated dependent component and acquiring the component style file of the updated dependent component and then includes:
and sending the updated component structure file of the dependent component and the updated component pattern file of the dependent component to a user terminal so that the user terminal renders the page of the target program according to the updated component structure file of the dependent component and the updated component pattern file of the dependent component.
In a second aspect, the present application provides a component style spacer comprising:
and the acquisition module is used for acquiring the absolute path information of the target program dependent component.
The structure file updating module is used for acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component so as to acquire an updated component structure file of the dependent component;
and the style file updating module is used for acquiring the component style file of the dependent component according to the absolute path information of the dependent component, and adding the component identifier of the corresponding component in the style selector in the component style file of the dependent component so as to acquire the updated component style file of the dependent component.
In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory to implement the component style isolation method of any of the aspects described above.
In a fourth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, are configured to implement the component style isolation method of any one of the above aspects.
In a fifth aspect, the present application provides a computer program product comprising computer-executable instructions which, when executed by a processor, implement the component style isolation method of any of the above aspects.
The method, the device, the equipment, the storage medium and the product for isolating the component patterns acquire absolute path information of the target program dependent component; acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component to acquire an updated component structure file of the dependent component; and acquiring a component pattern file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a pattern selector in the component pattern file of the dependent component to acquire an updated component pattern file of the dependent component. Isolation of component styles may be achieved by adding component identifications in class attributes in the component structure file and adding component identifications in style selectors in the component style file.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a flow chart of a method for isolating component styles provided in an embodiment of the present application;
fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a component style isolation device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Specific embodiments thereof have been shown by way of example in the drawings and will herein be described in more detail. These drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the following description of the embodiments, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
First, the prior art to which the present invention relates will be described in detail and analyzed.
The developer can abstract the functional modules within the page into custom components for reuse in different pages. Custom components are refinements of functionally consistent content that can be imported from different pages. There are global styles, page styles and component styles in applet engineering. Global styles may have an effect on styles on pages of an applet, a page style of a certain page does not affect other pages, while a component is a common file that can be referenced by at least one page, the contents of the component and the component styles may be packaged together on the page file, thus requiring isolation of the styles of the component, which would otherwise result in the page styles being contaminated by the component styles, or the component styles being contaminated by the page styles.
The inventor finds that, in the research, the class attribute is configured in the component structure file, which type (class) the element belongs to, the style selector in the component style file is used for designating the element with the function of the style, and the element with the designated type (class) can be selected, so that the isolation of the component styles can be realized by adding the component identifier in the class attribute and the style selector. The application provides a component style isolation method, which is used for acquiring absolute path information of a target program dependent component; acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component to acquire an updated component structure file of the dependent component; and acquiring a component pattern file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of the corresponding component in a pattern selector in the component pattern file of the dependent component to acquire an updated component pattern file of the dependent component.
In the technical scheme of the application, the related information such as financial data or user data is collected, stored, used, processed, transmitted, provided, disclosed and the like, which accords with the regulations of related laws and regulations and does not violate the popular regulations of the public order.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a component style isolation method provided in an embodiment of the present application, where the embodiment of the present application provides a component style isolation method for a problem that after an applet page introduces a component, a page style may be contaminated by the component style or the component style may be contaminated by the page style. The method in this embodiment is applied to a component-style separation device, which may be located in an electronic apparatus. Wherein the electronic device may be a digital computer representing various forms. Such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
As shown in fig. 1, the method specifically comprises the following steps:
step S101, obtaining absolute path information of the target program dependent component.
The target program can be a small program for developing and finishing the uploaded sub codes. An applet may include multiple pages, which may be broken up into multiple partial components, the components being the basic building blocks of the applet pages. The target program dependent component is the component referenced by the target program.
The embodiment of the application does not limit the way of acquiring the absolute path information of the dependent component of the target program, and for example, if a certain dependent component is a global registration component, the absolute path information of the dependent component can be directly acquired; if a certain dependent component is a page registration component, the relative path information of the dependent component can be acquired, and the absolute path information of the dependent component is determined through the corresponding page path information. After the absolute path information of the dependent component of the target program is obtained, the component structure file of the dependent component and the component style file of the dependent component can be searched from the target program engineering catalog.
Step S102, acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component to acquire an updated component structure file of the dependent component.
It should be understood that a component is typically composed of 4 files, a configuration file, a logic file, a structure file, and a style file. The configuration file, the logic file, the structure file and the style file of the same dependent component all correspond to the same absolute path.
The absolute path information in the present application includes a file name and does not include a file suffix.
For example, if the component structure file of the dependent component is an mxml file, after the absolute path information of the dependent component is obtained, the mxml suffix is added to the absolute path information to obtain the component structure file of the dependent component. For example, the absolute path information of the dependent components is: the small program engineering catalog/component 1 is added with mxml suffix after the absolute path information to obtain small program engineering catalog/component 1.Mxml, so as to obtain the component structure file of the dependent component: assembly 1.Mxml.
Step S103, obtaining a component pattern file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a pattern selector in the component pattern file of the dependent component to obtain an updated component pattern file of the dependent component.
In this embodiment of the present application, the manner of obtaining the component style file of the dependent component is similar to the manner of obtaining the component structure file of the dependent component, and if the component style file of the dependent component is an mcs file, the component style file of the dependent component may be obtained by adding an mcs suffix after obtaining absolute path information of the dependent component.
Class attributes of the component can be defined in the component structure file, class attributes class is a style class of the component, and class names of elements are defined. Class attributes are most often used to point to classes in style sheets.
A style selector is included in the component style file, and the style selector may determine elements that require a change in style.
The embodiment of the application is not limited to the manner of adding the component identifier of the corresponding component in the class attribute in the component structure file of the dependent component and adding the component identifier of the corresponding component in the style selector in the component style file of the dependent component, and it should be understood that the manner of adding the component identifier of the corresponding component in the class attribute and the component identifier of the corresponding component in the style selector should correspond. Illustratively, the value of the attribute of the class before updating is style 1, the corresponding component is identified as component 1, and if the value of the attribute of the class after updating is style 1+component 1, the updated style selector includes style 1+component 1; if the value of the updated class attribute is component 1+style 1, the updated style selector includes component 1+style 1.
In the embodiment of the application, the component identifier of the corresponding component is added in the class attribute in the component structure file of the dependent component, and the component identifier of the corresponding component is added in the style selector in the component style file of the dependent component, so that the component style is only used by the corresponding component, thereby realizing component style isolation.
The component style isolation method provided by the embodiment of the application obtains absolute path information of the target program dependent component; acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component to acquire an updated component structure file of the dependent component; and acquiring a component pattern file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of the corresponding component in a pattern selector in the component pattern file of the dependent component to acquire an updated component pattern file of the dependent component. Isolation of component styles may be achieved by adding component identifications in class attributes in the component structure file and adding component identifications in style selectors in the component style file.
Optionally, after obtaining the updated component structure file of the dependent component and obtaining the updated component style file of the dependent component, the method includes: and sending the updated component structure file of the dependent component and the updated component pattern file of the dependent component to the user terminal, so that the user terminal renders the page of the target program according to the updated component structure file of the dependent component and the updated component pattern file of the dependent component, and the applet pattern displayed at the user terminal is consistent with the design.
Fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application. As shown in fig. 2, the system includes an electronic device 1 and a user terminal 2, the electronic device 1 and the user terminal 2 are connected in communication, and a container capable of running a target program is arranged in the user terminal. After the developer of the applet submits the applet code, the electronic device 1 may execute the component style isolation method provided in the present application to obtain the updated component structure file of the dependent component and obtain the updated component style file of the dependent component, and generate an applet code package according to the updated component structure file of the dependent component and the updated component style file of the dependent component, and the user terminal 2 may download the applet code package from the electronic device 1, and render the page of the target program according to the updated component structure file of the dependent component and the updated component style file of the dependent component in the applet code package.
According to the component style isolation method provided by the embodiment of the application, after the updated component structure file of the dependent component is obtained, the updated component style file of the dependent component is obtained, and then the updated component structure file of the dependent component and the updated component style file of the dependent component are sent to the user terminal, so that the user terminal renders the page of the target program according to the updated component structure file of the dependent component and the updated component style file of the dependent component. The applet page displayed on the user terminal can be free from the influence of the component style, and the component can be displayed according to the corresponding component style.
Alternatively, the object dependent component may include: the embodiment relates to refinement of an implementation manner of acquiring absolute path information of a target program dependent component in step S101 on the basis of any one of the above embodiments, and specifically includes the following steps:
step S201, obtain target program data in compiling state.
Specifically, after the target program code submitted by the developer is obtained, the target program code is compiled first, and then the target program data in a compiling state is obtained. The object program data includes object program code, and the object program data may be an object program code package.
Step S202, a global public configuration file of the target program is obtained from the target program data in a compiling state, and absolute path information of a global registration component is obtained from the global public configuration file of the target program.
Specifically, a file reading function may be used to read a global public configuration file of the target program under the target program engineering catalog in the target program data, so as to obtain the content of the global public configuration file of the target program. The global public configuration file of the target program can be a JSON file, a JSON parameter API can be adopted to convert a character string in the content of the global public configuration file of the target program into a JSON object, and absolute path information including a global registration component in a usengcomponents field is obtained from the object.
It should be noted that, the global registration component referenced by the target program may be configured in the target program global public configuration file through using the usingComponents field.
According to the component style isolation method provided by the embodiment of the application, the object program data in the compiling state is obtained, the object program data in the compiling state is modified instead of the object program code submitted by the developer, the trouble to the small program developer can be avoided, and the developer can conveniently check and modify the submitted object program code. The global public configuration file of the target program is obtained from the target program data in the compiling state, and the absolute path information of the global registration component is obtained from the global public configuration file of the target program, so that the absolute path information of the global registration component can be obtained, the component structure file and the component style file corresponding to the global registration component are updated, and the isolation of the global registration component style is realized.
Step S203, adding the absolute path information of the global registration component into the component path information array.
Specifically, initializing a null array in advance, and determining the null array as a component path information array; after the absolute path information of the target program dependent component is obtained in step S203, step S207, and step S301, the obtained absolute path information of the target program dependent component may be added to the component path information array; if the absolute path information of the acquired target program dependent component exists in the component path information array, the absolute path information is not stored continuously. The repeated processing of the component structure file of the dependent component of the target program and the component style file of the dependent component can be avoided.
Optionally, the object dependent component further comprises: the page registration component, the way of obtaining the absolute path information of the page registration component, includes:
step S204, acquiring page path information of the target program from the global public configuration file of the target program.
In the embodiment of the present application, the manner of acquiring the page path information of the target program from the global public configuration file of the target program is similar to the manner of acquiring the absolute path information of the global registration component.
For example, if the language of the object program code is node, the fs library may be used to read the global public configuration file of the object program, and page path information of the object program included in the pages field and the sub-pages field may be obtained from the global public configuration file of the object program.
Step S205, a page configuration file of a target program page is obtained according to page path information of the target program, and relative path information of a page registration component corresponding to each page is obtained from the page configuration file.
In this embodiment of the present invention, the method for obtaining the page configuration file of the target program page according to the page path information of the target program is similar to the method for obtaining the component structure file of the dependent component according to the absolute path information of the dependent component in step S102, and will not be described in detail here. It should be understood that one page of the applet is composed of at least 3 files, respectively a configuration file, a logical file, a structure file, and may also include a style file. The configuration file, the logic file, the structure file and the style file of the same page all correspond to the same absolute path. The configuration file can be a json file, and the page configuration file of the target program page can be obtained by adding a json suffix after the page path information of the target program.
Optionally, after the page path information of the target program is acquired, the page path information of the target program is added into the page path information array, and the page configuration file of the page of the target program is acquired by traversing the page path information in the page path information array and the relative path information of the corresponding page registration component is acquired.
In this embodiment of the present application, the manner of acquiring the relative path information of the page registration component corresponding to each page from the page configuration file is similar to the manner of acquiring the absolute path information of the global registration component from the global public configuration file of the target program in step S202, and the relative path information of the page registration component included in the usingComponents field may be acquired from the page configuration file.
It should be noted that the page registration component referenced by the target program page may be configured in the page configuration file through the usingComponents field.
Step S206, determining the absolute path information of the page registration component according to the page path information and the relative path information of the corresponding page registration component.
It should be noted that the page registration component referenced by the target program page may be configured in the page configuration file through the usingComponents field. The page registration component configured through the usingComponents field in the page configuration file is the relative path information of the page registration component. The absolute path information of the page registration component can be determined according to the page path information and the relative path information of the corresponding page registration component.
Specifically, the first input parameter of the join api may be determined as page path information, the second input parameter may be determined as relative path information of the page registration component corresponding to the page, and absolute path information of the page registration component returned by the join api may be obtained.
According to the component style isolation method provided by the embodiment of the application, page path information of a target program is obtained from a global public configuration file of the target program; acquiring a page configuration file of a target program page according to page path information of the target program, and acquiring relative path information of a page registration component corresponding to each page from the page configuration file; and determining the absolute path information of the page registration component according to the page path information and the relative path information of the corresponding page registration component. The absolute path information of the page registration component can be obtained, so that the component structure file and the component style file corresponding to the page registration component are updated, and the isolation of the page registration component is realized.
Step S207, adding the absolute path information of the page registration component into the component path information array.
Optionally, the object dependent component further comprises: the component registration component, the way of obtaining the absolute path information of the component registration component includes:
Step S208, acquiring component configuration files of the global registration component and the page registration component according to the absolute path information in the component path information array, and acquiring the relative path information of the component registration component from the component configuration files of the global registration component and the page registration component.
Step S209, determining the absolute path information of the component registration component according to the absolute path information in the component path information array and the relative path information of the corresponding component registration component.
It should be understood that components may also refer to other component content, i.e., the granularity of the components may also be smaller.
Specifically, the absolute path information in the component path information array can be traversed circularly, and json suffixes are added to obtain component configuration files of the global registration component and the page registration component; the relative path information of the component registration component included in the usingComponents field is acquired from the component profile.
In this embodiment of the present application, the manner of determining the absolute path information of the component registration component according to the absolute path information in the component path information array and the relative path information of the corresponding component registration component is similar to the manner of determining the absolute path information of the page registration component according to the page path information and the relative path information of the corresponding page registration component in step S206, and will not be described in detail herein.
It should be noted that, in the embodiment of the present application, the order of obtaining the absolute path information of the component registration component and the absolute path information of the global registration component is not limited, and the absolute path information of the component registration component is obtained after the absolute path information of the component registration component and the absolute path information of the global registration component are obtained.
According to the component style isolation method provided by the embodiment of the application, after the absolute path information of the global registration component and the absolute path information of the page registration component are added into the component path information array, the absolute path information of the component registration component is obtained according to the component path information array, so that the absolute path information of the component registration component can be obtained, the component structure file and the component style file corresponding to the component registration component are updated, and the isolation of the component registration component is realized.
Optionally, the step S102 may be implemented in such a way that the component structure file of the dependent component is obtained according to the absolute path information of the dependent component, and the component identifier of the corresponding component is added to the class attribute in the component structure file of the dependent component to obtain the updated component structure file of the dependent component:
step S301, adding the absolute path information of the component registration component into a component path information array.
Step S302, a component structure file of the dependent component is obtained by adding a structure file suffix after absolute path information of a global registration component, absolute path information of a page registration component and absolute path information of the component registration component in the component path information array.
For example, if the component structure file is an mxml file, an mxml suffix may be added after the absolute path information of the dependent component in the component path information array to obtain the component structure file of the dependent component.
In the embodiment of the application, the global registration component, the page registration component and the absolute path information of the component registration component are added into the component path information array, and the component structure file and the component style file of the dependent component are acquired according to the component path information array, so that missing of the component on which the target program depends can be avoided, and repeated processing of the component structure file and the component style file of the dependent component of the target program can be avoided.
And step S303, analyzing the component structure file into a component structure abstract syntax tree.
One way to parse a component structure file into a component structure abstract syntax tree may be: if the component structure file is an mxml file, converting the mxml file into an AST component structure abstract syntax tree by adopting a parse5 library.
It should be understood that an abstract syntax tree (abbreviated AST in english) is a tree representation of the abstract syntax structure of source code, each node on the tree representing a structure in the source code. After the component structure file is analyzed into a component structure abstract syntax tree, whether the class attribute exists in the dependent component can be determined by inquiring the attribute of the root node in the AST; if it is determined that the class attribute does not exist in the root node in the component structure abstract syntax tree, determining that the class attribute of the component is not defined, and executing step S304A to add the class attribute for the root node, and determining that the value of the class attribute is the component identifier of the corresponding component; if it is determined that the class attribute exists in the root node of the component structure abstract syntax tree, determining the class attribute of the defined dependent component, step S304B may be performed to add the component identifier of the corresponding component after the value of the class attribute to update the value of the class attribute in the component structure abstract syntax tree.
In the embodiment of the application, the component structure file is analyzed into AST instead of using the regular expression, so that the accuracy of conversion can be improved.
Step S304A, if the fact that the class attribute does not exist in the root node in the component structure abstract syntax tree is determined, the class attribute is added for the root node, and the value of the class attribute is determined to be the component identifier of the corresponding component.
Specifically, if it is determined that the class attribute does not exist in the root node in the abstract syntax tree of the component structure, { name: "class", value: "component name" } may be added to the attrs field (which is an array) of the root node, that is, a class attribute is added, and the value is the component identifier of the corresponding component.
One way to obtain the component identifier may be to determine the intercepted content as the component identifier of the corresponding component from the content of the component structure file after the absolute path information last "/" of the corresponding component. For example, the absolute path information of the corresponding component is: the applet engineering path/components/hello/hello determines that the component of the corresponding component is identified as hello.
Step S304B, if the root node in the component structure abstract syntax tree is determined to have the class attribute, adding the component identifier of the corresponding component after the value of the class attribute to update the value of the class attribute in the component structure abstract syntax tree.
Specifically, if it is determined that the class attribute exists in the root node in the abstract syntax tree of the component structure, for example { name: "class", value: "component style 1" }, the value of the class attribute is: component style 1) then adds the component identity of the corresponding component after the value of the class attribute to update the value of the class attribute in the component structure abstract syntax tree. Illustratively, if the component identifier of the corresponding component is hello, the value of the updated class attribute is: component style 1hello.
Step S305, converting the updated component structure abstract syntax tree into a structure file to obtain the component structure file of the updated dependent component.
The way to transform the updated component structure abstract syntax tree into a structure file to obtain the updated component structure file of the dependent component may be: if the component structure file is an mxml file, the updated AST component structure abstract syntax tree can be converted into the component structure file by adopting a serializapi of a parse5 library.
In this embodiment, a class attribute is defined in the updated component structure file of the dependent component, and the value of the class attribute includes the component identifier of the corresponding component.
According to the component style isolation method provided by the embodiment of the application, the component structure file is analyzed into a component structure abstract syntax tree; if the fact that the class attribute does not exist in the root node in the abstract syntax tree of the component structure is determined, adding the class attribute to the root node, and determining the value of the class attribute as a component identifier of a corresponding component; if the class attribute exists in the root node in the component structure abstract syntax tree, adding a component identifier of a corresponding component after the value of the class attribute to update the value of the class attribute in the component structure abstract syntax tree; and converting the updated component structure abstract syntax tree into a structure file to obtain the component structure file of the updated dependent component. The component identification may be included in the values of class attributes defined in the component structure file of the dependent component, thereby enabling isolation of the dependent component style.
Optionally, step S103 may be implemented in such a way that the component style file of the dependent component is obtained according to the absolute path information of the dependent component, and the component identifier of the corresponding component is added to the style selector in the component style file of the dependent component to obtain the updated component style file of the dependent component:
step S306, the component pattern file of the dependent component is obtained by adding a pattern file suffix after the absolute path information of the global registration component, the absolute path information of the page registration component and the absolute path information of the component registration component in the component path information array.
For example, if the component style file is an mcs file, an mcs suffix may be added after the absolute path information of the dependent component in the component path information array to obtain the component style file of the dependent component.
Step S307, the component style file is parsed into a component style abstract syntax tree, and a style selector in the component style abstract syntax tree is obtained.
The parsing of the component style file into the component style abstract syntax tree may be: if the component style file is an mcs file, a postacs library may be used to convert the mcs file to an AST component style abstract syntax tree. It should be understood that postscs is a tool that converts CSS code with JavaScript tools and plug-ins, and can process CSS files (including mcss files).
In addition, the postacs library walkRules API may be employed to retrieve style selectors in the component style abstract syntax tree.
Step S308, if it is determined that the element in the style selector includes the root node style information, the component identifier of the corresponding component is added after the root node style information in the element to update the style selector in the component style abstract syntax tree.
Step S309, if it is determined that the element in the style selector does not include the root node style information, the component identifier of the corresponding component is added before the element to update the style selector in the component style abstract syntax tree.
The root node style information is the value of the attribute of the root node class in the component structure abstract syntax tree. Specifically, when step S304B is executed, if it is determined that the class attribute exists in the root node in the abstract syntax tree of the component structure, the value of the class attribute is determined as the root node style information, and the component identifier of the corresponding component is added after the value of the class attribute to update the value of the class attribute. Illustratively, if it is determined that the class attribute exists in the root node in the component structure abstract syntax tree, a value of the class attribute is: component style 1, determining the component style 1 as root node style information, adding a component identifier of a corresponding component after the value of the class attribute, for example, adding hello, and updating the value of the class attribute to be: component style 1hello.
It should be appreciated that a number of elements may be included in the style selector, e.g., style selector div, span { color: red }, the style selector seed including elements div and span. The embodiment of the application determines the elements included in the style selector by determining whether the style selector exists or not.
After determining the elements included in the style selector, determining whether the elements in the style selector include root node style information; if it is determined that the root node style information is included, step S308 is performed to increase the component identifier of the corresponding component after the root node style information in the element; if it is determined that the root node style information is not included, step S309 is performed to increase the component identification of the corresponding component before the element.
Illustratively, if the style selector is: component style 1.Log, div { color: black }, and the root node style information includes component style 1, the component identifier of the corresponding component being component 1; determining elements in the style selector includes: the element style 1.Log comprises root node style information, and the element identifier is added after the root node style information in the element; the element div does not comprise root node style information, and the component identification of the corresponding component is added before the element; the updated style selector may be obtained: component style 1 component 1.Log component 1div { color black }. Wherein the component identification may be preceded by the symbol "".
Step S310, converting the updated component style abstract syntax tree into a style file to obtain an updated style structure file of the dependent component.
Illustratively, the updated AST component style abstract syntax tree may be converted to a style file using a postscs library. The style selector in the updated component-dependent style structure file is the style selector that adds the component identity.
According to the component style isolation method provided by the embodiment of the application, a component style file is analyzed into a component style abstract syntax tree, and a style selector in the component style abstract syntax tree is obtained; if the element in the style selector is determined to comprise the root node style information, adding the component identifier of the corresponding component after the root node style information in the element so as to update the style selector in the component style abstract syntax tree; if the element in the style selector does not comprise the root node style information, adding the component identifier of the corresponding component before the element so as to update the style selector in the component style abstract syntax tree; and converting the updated component style abstract syntax tree into a style file to obtain an updated style structure file of the dependent component. The component identification may be included in a defined style selector in the component-dependent style structure file, thereby enabling isolation of the dependent component styles.
Fig. 3 is a schematic structural diagram of a component style isolation device according to an embodiment of the present application. The component style isolation device provided by the embodiment of the application can execute the processing flow provided by the embodiment of the component style isolation method. As shown in fig. 3, the assembly type isolating device 50 includes: the module for obtaining 501, the module for updating structure file 502, the module for updating style file 503.
Specifically, the obtaining module 501 is configured to obtain absolute path information of the target program dependent component.
The structure file updating module 502 is configured to obtain a component structure file of the dependent component according to the absolute path information of the dependent component, and add a component identifier of the corresponding component in the class attribute in the component structure file of the dependent component to obtain an updated component structure file of the dependent component.
A style file updating module 503, configured to obtain a component style file of the dependent component according to the absolute path information of the dependent component, and add a component identifier of the corresponding component to a style selector in the component style file of the dependent component to obtain an updated component style file of the dependent component.
The apparatus provided in the embodiments of the present application may be specifically configured to perform the method embodiments provided in the foregoing embodiments, and specific functions are not described herein.
Optionally, the object dependent component includes: the global registration component, the acquisition module 501 is specifically configured to:
acquiring target program data in a compiling state; and acquiring a global public configuration file of the target program from the target program data in the compiling state, and acquiring absolute path information of the global registration component from the global public configuration file of the target program.
Optionally, the object dependent component further comprises: the page registration component, the obtaining module 501 is specifically further configured to:
acquiring page path information of a target program from a global public configuration file of the target program; acquiring a page configuration file of a target program page according to page path information of the target program, and acquiring relative path information of a page registration component corresponding to each page from the page configuration file; and determining the absolute path information of the page registration component according to the page path information and the relative path information of the corresponding page registration component.
Optionally, the object dependent component further comprises: the component registration component, the obtaining module 501 is specifically further configured to:
adding absolute path information of the global registration component and absolute path information of the page registration component into a component path information array; acquiring component configuration files of the global registration component and the page registration component according to absolute path information in the component path information array, and acquiring relative path information of the component registration component from the component configuration files of the global registration component and the page registration component; and determining the absolute path information of the component registration component according to the absolute path information in the component path information array and the relative path information of the corresponding component registration component.
Optionally, the structure file update module 502 includes: a structure file acquisition unit for: adding absolute path information of the component registration component into a component path information array; and obtaining the component structure file of the dependent component by adding the structure file suffix after the absolute path information of the global registration component, the absolute path information of the page registration component and the absolute path information of the component registration component in the component path information array.
The style file update module 503 includes: a style file acquisition unit for: and obtaining the component style file of the dependent component by adding the suffix of the style file after the absolute path information of the global registration component, the absolute path information of the page registration component and the absolute path information of the component registration component in the component path information array.
Optionally, the structure file updating module 502 further includes a structure file updating unit, where the structure file updating unit is configured to:
resolving the component structure file into a component structure abstract syntax tree; if the fact that the class attribute does not exist in the root node in the abstract syntax tree of the component structure is determined, adding the class attribute to the root node, and determining the value of the class attribute as a component identifier of a corresponding component; if the class attribute exists in the root node in the component structure abstract syntax tree, adding a component identifier of a corresponding component after the value of the class attribute to update the value of the class attribute in the component structure abstract syntax tree; and converting the updated component structure abstract syntax tree into a structure file to obtain the component structure file of the updated dependent component.
Optionally, the structure file updating unit is specifically configured to: if the existence of the class attribute of the root node in the component structure abstract syntax tree is determined, determining the value of the class attribute as the root node style information, and adding the component identifier of the corresponding component after the value of the class attribute to update the value of the class attribute.
The style file update module 503 further includes: a style file updating unit for:
analyzing the component style file into a component style abstract syntax tree, and acquiring a style selector in the component style abstract syntax tree; if the element in the style selector is determined to comprise the root node style information, adding the component identifier of the corresponding component after the root node style information in the element so as to update the style selector in the component style abstract syntax tree; if the element in the style selector does not comprise the root node style information, adding the component identifier of the corresponding component before the element so as to update the style selector in the component style abstract syntax tree; and converting the updated component style abstract syntax tree into a style file to obtain an updated style structure file of the dependent component.
Optionally, the component style isolation device 50 further includes: the sending module, after the structure file updating module 502 obtains the updated component structure file of the dependent component, the style file updating module 503 obtains the updated component style file of the dependent component, and then the sending module is configured to:
And sending the updated component structure file of the dependent component and the updated component pattern file of the dependent component to the user terminal so that the user terminal renders the page of the target program according to the updated component structure file of the dependent component and the updated component pattern file of the dependent component.
The apparatus provided in the embodiments of the present application may be specifically configured to perform the foregoing method embodiments, and specific functions are not described herein.
Fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, as shown in fig. 4, the present application further provides an electronic device 60, including: memory 601, and processor 602.
The memory 601 is used for storing computer execution instructions, and the memory 601 and the processor 602 are connected in communication. In particular, the program may include program code including computer-executable instructions. The memory 601 may comprise a high-speed RAM memory or may further comprise a non-volatile memory (non-volatile memory), such as at least one disk memory.
A processor 602 for executing stored computer-executable instructions stored in the memory 601.
Wherein computer-executable instructions are stored in memory 601 and are configured to be executed by processor 602 to implement the methods provided by any of the embodiments of the present application. The related descriptions and effects corresponding to the steps in the drawings can be understood correspondingly, and are not repeated here.
In the embodiment of the present application, the memory 601 and the processor 602 are connected through a bus. The bus may be an industry standard architecture (Industry Standard Architecture, abbreviated ISA) bus, an external device interconnect (Peripheral Component Interconnect, abbreviated PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus.
The embodiment of the application also provides a computer readable storage medium, wherein computer executable instructions are stored in the computer readable storage medium, and the computer executable instructions are used for realizing the method provided by any embodiment of the application when being executed by a processor.
Embodiments of the present application also provide a computer program product comprising computer-executable instructions that, when executed by a processor, implement the method provided by any of the embodiments of the present application.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules is merely a logical function division, and there may be additional divisions of actual implementation, e.g., multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in hardware plus software functional modules.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable full path trace fusion apparatus, such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram block or blocks to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Moreover, although operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present application. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (12)

1. A method of component style isolation, comprising:
acquiring absolute path information of a target program dependent component;
acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component to acquire an updated component structure file of the dependent component;
And acquiring a component pattern file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a pattern selector in the component pattern file of the dependent component to acquire an updated component pattern file of the dependent component.
2. The method of claim 1, wherein the object dependent component comprises: the global definition file is stored in a code repository to list components, and the obtaining of the absolute path information of the target program dependent components comprises:
acquiring target program data in a compiling state;
and acquiring the global public configuration file of the target program from the target program data in the compiling state, and acquiring the absolute path information of the global registration component from the global public configuration file of the target program.
3. The method of claim 2, wherein the object dependent component further comprises: the page registration component, which obtains the absolute path information of the target program dependent component, further includes:
acquiring page path information of a target program from the global public configuration file of the target program;
acquiring a page configuration file of a target program page according to the page path information of the target program, and acquiring relative path information of a page registration component corresponding to each page from the page configuration file;
And determining the absolute path information of the page registration component according to the page path information and the relative path information of the corresponding page registration component.
4. The method of claim 3, wherein the object dependent component further comprises: the component registration component, which obtains the absolute path information of the target program dependent component, further includes:
adding the absolute path information of the global registration component and the absolute path information of the page registration component into a component path information array;
acquiring component configuration files of a global registration component and a page registration component according to absolute path information in the component path information array, and acquiring relative path information of the component registration component from the component configuration files of the global registration component and the page registration component;
and determining the absolute path information of the component registration component according to the absolute path information in the component path information array and the relative path information of the corresponding component registration component.
5. The method of claim 4, wherein the obtaining the component structure file of the dependent component according to the absolute path information of the dependent component comprises:
Adding the absolute path information of the component registration component into a component path information array;
obtaining a component structure file of a dependent component by adding a structure file suffix after absolute path information of a global registration component, absolute path information of a page registration component and absolute path information of the component registration component in the component path information array;
the obtaining the component style file of the dependent component according to the absolute path information of the dependent component comprises the following steps:
and obtaining the component style file of the dependent component by adding the suffix of the style file after the absolute path information of the global registration component, the absolute path information of the page registration component and the absolute path information of the component registration component in the component path information array.
6. The method according to claim 1, wherein adding the component identifier of the corresponding component to the class attribute in the component structure file of the dependent component to obtain the updated component structure file of the dependent component includes:
analyzing the component structure file into a component structure abstract syntax tree;
if the fact that the class attribute does not exist in the root node in the component structure abstract syntax tree is determined, adding the class attribute to the root node, and determining the value of the class attribute as a component identifier of a corresponding component;
If the class attribute exists in the root node in the component structure abstract syntax tree, adding a component identifier of a corresponding component after the value of the class attribute to update the value of the class attribute in the component structure abstract syntax tree;
and converting the updated component structure abstract syntax tree into a structure file to obtain the component structure file of the updated dependent component.
7. The method of claim 6, wherein if it is determined that the class attribute exists in the root node in the component structure abstract syntax tree, adding the component identifier of the corresponding component to update the value of the class attribute after the value of the class attribute comprises:
if the fact that the class attribute exists in the root node in the component structure abstract syntax tree is determined, determining the value of the class attribute as root node style information, and adding a component identifier of a corresponding component after the value of the class attribute to update the value of the class attribute;
adding the component identifier of the corresponding component in the style selector in the component style file of the dependent component to obtain the updated component style file of the dependent component, including:
analyzing the component style file into a component style abstract syntax tree, and acquiring a style selector in the component style abstract syntax tree;
If the element in the style selector is determined to comprise the root node style information, adding a component identifier of a corresponding component after the root node style information in the element so as to update the style selector in the component style abstract syntax tree;
if the element in the style selector does not comprise the root node style information, adding a component identifier of a corresponding component before the element so as to update the style selector in the component style abstract syntax tree;
and converting the updated component style abstract syntax tree into a style file to obtain an updated style structure file of the dependent component.
8. The method of claims 1-7, wherein obtaining the updated component structure file of the dependent component and obtaining the updated component style file of the dependent component and thereafter comprises:
and sending the updated component structure file of the dependent component and the updated component pattern file of the dependent component to a user terminal so that the user terminal renders the page of the target program according to the updated component structure file of the dependent component and the updated component pattern file of the dependent component.
9. A component style isolator device, comprising:
the acquisition module is used for acquiring absolute path information of the target program dependent component;
the structure file updating module is used for acquiring a component structure file of the dependent component according to the absolute path information of the dependent component, and adding a component identifier of a corresponding component in a class attribute in the component structure file of the dependent component so as to acquire an updated component structure file of the dependent component;
and the style file updating module is used for acquiring the component style file of the dependent component according to the absolute path information of the dependent component, and adding the component identifier of the corresponding component in the style selector in the component style file of the dependent component so as to acquire the updated component style file of the dependent component.
10. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the method of any one of claims 1-7.
11. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1-7.
12. A computer program product comprising computer-executable instructions which, when executed by a processor, implement the method of any one of claims 1-7.
CN202310184743.8A 2023-02-20 2023-02-20 Component style isolation method, device, equipment, storage medium and product Pending CN116150527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310184743.8A CN116150527A (en) 2023-02-20 2023-02-20 Component style isolation method, device, equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310184743.8A CN116150527A (en) 2023-02-20 2023-02-20 Component style isolation method, device, equipment, storage medium and product

Publications (1)

Publication Number Publication Date
CN116150527A true CN116150527A (en) 2023-05-23

Family

ID=86356189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310184743.8A Pending CN116150527A (en) 2023-02-20 2023-02-20 Component style isolation method, device, equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN116150527A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117519726A (en) * 2023-12-20 2024-02-06 中国电信股份有限公司技术创新中心 Front-end assembly style verification method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117519726A (en) * 2023-12-20 2024-02-06 中国电信股份有限公司技术创新中心 Front-end assembly style verification method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
CN111736840B (en) Method for compiling applet application, method for running applet application, storage medium and electronic device
CN103294598B (en) A kind of source code inspection method and device
CN111831384B (en) Language switching method, device, equipment and storage medium
CN102117241A (en) Multi-core system debugging method and multi-core system
CN111124479B (en) Method and system for analyzing configuration file and electronic equipment
CN113139390A (en) Language conversion method and device applied to code character strings
CN112463256A (en) Method, system, electronic device and storage medium for determining configuration file
CN110727429A (en) Front-end page generation method, device and equipment
CN113760729A (en) Code detection method and device
CN116150527A (en) Component style isolation method, device, equipment, storage medium and product
CN113901083A (en) Heterogeneous data source operation resource analysis positioning method and equipment based on multiple analyzers
CN118245050B (en) Front end frame assembly automatic conversion method, system, electronic device and storage medium
CN111736812A (en) Document code execution method and device, computer equipment and storage medium
WO2022068556A1 (en) Code translation method and apparatus, and device
CN113238739A (en) Plug-in development and data acquisition method, device, electronic equipment and medium
CN117008920A (en) Engine system, request processing method and device, computer equipment and storage medium
CN112764757A (en) Applet processing method, device, equipment and storage medium
CN111443979A (en) Document processing method and device, computer equipment and storage medium
CN111240790A (en) Multi-language adaptation method and device for application, client and storage medium
CN114625373A (en) Application conversion method and device, electronic equipment and storage medium
CN113760249B (en) Program file processing method, device and equipment
CN111596997B (en) UI information request method, device, terminal and storage medium
CN114238831A (en) HTML code fragment processing method, system, electronic equipment and storage medium
CN112379885A (en) Applet compiling method, device and equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination