CN115756421A - Method, device and storage medium for modifying page style - Google Patents

Method, device and storage medium for modifying page style Download PDF

Info

Publication number
CN115756421A
CN115756421A CN202211476125.2A CN202211476125A CN115756421A CN 115756421 A CN115756421 A CN 115756421A CN 202211476125 A CN202211476125 A CN 202211476125A CN 115756421 A CN115756421 A CN 115756421A
Authority
CN
China
Prior art keywords
data
style
page
attribute
modification
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
CN202211476125.2A
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.)
Guangzhou Baolun Electronics Co Ltd
Original Assignee
Guangzhou Baolun Electronics 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 Guangzhou Baolun Electronics Co Ltd filed Critical Guangzhou Baolun Electronics Co Ltd
Priority to CN202211476125.2A priority Critical patent/CN115756421A/en
Publication of CN115756421A publication Critical patent/CN115756421A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device and a storage medium for modifying page styles, wherein the method comprises the following steps: when style modification data are received, intercepting page style data of a first cssWatcher instance according to a modification object and a modification attribute, and assigning values to corresponding attribute data in the page style data according to the modification attribute value; wherein the style modification data comprises a modification object, a modification attribute, and a modification attribute value; the page style data is bound with a corresponding page style of the cssWatcher file; according to the modified page style data, the corresponding page attribute of the cssWatcher file is assigned to obtain a new page style, the style modification mode is unified, the style modification is convenient, the page style can be modified only by intercepting the corresponding attribute value, the use of dom is reduced, the code amount is reduced, and the operation performance is optimized.

Description

Method, device and storage medium for modifying page style
Technical Field
The present invention relates to the field of front-end development technologies, and in particular, to a method and an apparatus for modifying a page style, and a storage medium.
Background
At present, when vue is used, the style of the template tag can be bound, then the style value and the data value in vue are bound to realize a style response formula, in the case of using vue or other response type frames, the method can be used for realizing dynamic modification of the page style through js, and the style of the page can also be modified through js adding classes or acquiring corresponding dom elements.
The method for modifying the page style at present can be used only in some responsive frames, and if the style is complex, a lot of long codes exist, so that a method for adding c types is generally adopted to modify the style, new classes are frequently added and some dom operations are frequently carried out, and the code writing and management efficiency is low; in addition, the operation of modifying the style through js has high repeatability, a great amount of operation of modifying the style through obtaining the dom exists in the jq project, and the place of the style modification needs to be searched back and forth during maintenance under the condition that the style file is separated from the js file, so that the code redundancy is high, the maintenance is inconvenient, and the performance problem of a browser page is easily caused during the dom operation.
Disclosure of Invention
The invention provides a method, a device and a storage medium for modifying page styles, which are used for reducing code amount and are simple and convenient to maintain in a mode of realizing uniform style modification.
In order to implement a uniform style modification mode, an embodiment of the present invention provides a method for modifying a page style, including:
when style modification data are received, intercepting page style data of a first cssWatcher instance according to a modification object and a modification attribute, and assigning values to corresponding attribute data in the page style data according to the modification attribute values;
wherein the style modification data comprises a modification object, a modification attribute, and a modification attribute value; the page style data is bound with a corresponding page style of the cssWatcher file;
and according to the modified page style data, assigning a corresponding page attribute of the cssWatcher file to obtain a new page style.
As an optimal scheme, because the page style data is bound with the corresponding page style of the cssWatcher file, when style modification data is received, the corresponding page style of the cssWatcher file can be modified in a linkage manner only by intercepting the page style data of the first cssWatcher instance and modifying the corresponding style attribute value, the style modification mode is unified, the style modification is convenient, the page style can be modified only by intercepting the corresponding attribute value, the use of dom is reduced, the code amount is reduced, and the operation performance is optimized.
Preferably, before receiving the style modification data, the method further includes:
acquiring an input cssWatcher file, wherein the input cssWatcher file comprises data parameters;
creating a first cssWatcher instance in js according to the input cssWatcher file, the first cssWatcher instance including page style data;
assigning values to attribute data in the page style data according to the data parameters; and binding the corresponding page style in the cssWatcher file according to the attribute data of the page style data.
As a preferred scheme, the invention registers the attribute in the cssWatcher instance when creating the cssWatcher instance, binds the attribute of the cssWatcher file, and can modify the attribute of the cssWatcher file when js modifies the attribute data of the intercepted page style data, so as to modify the page style, unify the style modification mode, facilitate the style modification, reduce the code amount and optimize the operation performance.
As a preferred scheme, according to the data parameter, assigning a value to attribute data in the page style data, specifically:
converting the data parameters into data parameter character strings; assigning values to page style data according to the data parameter character string;
wherein the data parameters comprise all attribute data parameters; the page style data is created by dom, and the page style data is recorded by the text of the dom object.
As a preferred scheme, when a cssWatcher instance is created, according to input data parameters, page style data is assigned, the data parameters are registered to style attributes of the page style data, the style attributes of the page style data can be modified to the attributes of the cssWatcher file at the same time when js modifies the attribute values of the intercepted page style data after being bound with the attributes of the cssWatcher file, and page style modification is carried out.
As a preferred scheme, according to the attribute data of the page style data, binding a corresponding page style in the csswatch file, specifically:
according to the attribute data of the page style data, assigning the corresponding page attribute of the cssWatcher file through a var function to obtain a corresponding page style;
and when the attribute data of the style of the page style data is changed, re-assigning the corresponding page attribute of the cssWatcher file through the var function to acquire a new page style.
As an optimal scheme, after the data parameters are registered to the style attributes of the page style data, the corresponding attributes of the cssWatcher file are assigned through a var function, the binding of the style attributes of the page style data and the attributes of the cssWatcher file is realized, the attributes of the cssWatcher file can be modified simultaneously when js modifies the attribute values of the intercepted page style data, the page style modification is carried out, the style modification mode is unified, the style modification is convenient, the code amount is reduced, and the response type development of css is realized.
As a preferred scheme, intercepting page style data of a first csswatch instance, and assigning a value to corresponding attribute data in the page style data according to a modified attribute value, specifically:
intercepting page style data of a first cssWatcher instance through an interceptor, and obtaining an intercepted object of the page style data, a style attribute of the intercepted object, and a style attribute value of the intercepted object through a set function;
and executing a setSty l e method according to the modified attribute value, and assigning the modified attribute value to the style attribute value of the interception object of the page style data.
As a preferred scheme, the interceptor intercepts the page style data of the first cssWatcher instance, and the setSty l e method is executed to modify the corresponding style attribute data in the page style data, so that the corresponding page style of the cssWatcher file can be modified in a linkage manner, the page style can be modified, the style modification mode is unified, the style modification is convenient, the code amount is reduced, and the response type development of css is realized.
Preferably, after the step of assigning the modification attribute value to the style attribute value of the intercepted object of the page style data, the method further includes:
and according to the modified page style data, assigning a corresponding page attribute of the cssWatcher file through a var function, and acquiring a new page style.
As a preferred scheme, the interceptor intercepts the page style data of the first cssWatcher instance, the setSty l e method is executed to modify the corresponding style attribute data in the page style data, and then the var function is used for reassigning the corresponding page attribute of the cssWatcher file according to the modified page style data, modifying the corresponding page style of the cssWatcher file in a linkage manner, modifying the page style, unifying the style modification manner, facilitating the style modification, reducing the code amount and realizing the response development of css.
Correspondingly, the invention also provides a device for modifying the page style, which comprises the following components: an interception module and a modification module;
the intercepting module is used for intercepting the page style data of the first cssWatcher instance according to the modification object and the modification attribute when receiving the style modification data;
the modification module is used for assigning values to corresponding attribute data in the page style data according to the modified attribute values; the style modification data includes a modification object, a modification attribute, and a modification attribute value; the page style data is bound with a corresponding page style of the cssWatcher file;
and according to the modified page style data, assigning a value to the corresponding page attribute of the cssWatcher file, and acquiring a new page style.
As an optimal scheme, because the page style data is bound with the corresponding page style of the cssWatcher file, when style modification data is received, the intercepting module intercepts the page style data of the first cssWatcher instance, and then modifies the corresponding style attribute value by the modifying module, the corresponding page style of the cssWatcher file can be modified in a linkage manner, the style modification manner is unified, the style modification is convenient, the page style can be modified only by intercepting the corresponding attribute value, the use of dom is reduced, the code amount is reduced, and the operation performance is optimized.
As a preferred solution, the apparatus for modifying a page style provided by the present invention further includes: a creating module and a binding module;
the creating module is used for acquiring an input cssWatcher file, and the input cssWatcher file comprises data parameters; creating a first cssWatcher instance in js according to the input cssWatcher file, the first cssWatcher instance comprising page style data;
the binding module comprises: a parameter acquisition unit and a style acquisition unit;
the parameter acquisition unit is used for converting the data parameters into data parameter character strings; assigning values to page style data according to the data parameter character string; wherein the data parameters include all attribute data parameters; the page style data is created through dom and is recorded by using the text of a dom object;
the style obtaining unit is used for assigning the corresponding page attribute of the cssWatcher file through a var function according to the attribute data of the page style data to obtain the corresponding page style; and when the attribute data of the style of the page style data is changed, assigning the corresponding page attribute of the cssWatcher file again through the var function to obtain a new page style.
As a preferred scheme, according to the device for modifying the page style, the binding module assigns values to the page style data according to the input data parameters, registers the data parameters to the style attributes of the page style data, and after the style attributes of the page style data can be bound with the attributes of the cssWatcher file, the attributes of the cssWatcher file can be modified simultaneously when js modifies the intercepted attribute values of the page style data, so that the page style can be modified.
Preferably, the modification module comprises an attribute modification unit and a style modification unit;
the attribute modification unit is used for executing a setSty l method according to a modification attribute value, and endowing the modification attribute value to a style attribute value of an interception object of the page style data;
and the style modification unit is used for assigning the modified attribute value to the style attribute value of the interception object of the page style data, and then assigning the corresponding page attribute of the cssWatcher file through a var function according to the modified page style data to acquire a new page style.
As a preferred scheme, after the interception module intercepts the page style data of the first cssWatcher instance, the attribute modification unit of the modification module executes a setSty l e method to modify the corresponding style attribute data in the page style data, so that the corresponding page style of the cssWatcher file can be modified by the linkage style modification unit, the page style can be modified, the style modification mode is unified, the style modification is convenient, the code amount is reduced, and the response development of css is realized.
Accordingly, the present invention also provides a computer readable storage medium comprising a stored computer program; wherein the computer program, when running, controls the device on which the computer readable storage medium is located to perform a method for modifying page style according to the present disclosure.
Drawings
FIG. 1 is a flowchart illustrating an embodiment of a method for modifying a page style provided by the present invention;
FIG. 2 is a schematic structural diagram of an embodiment of an apparatus for modifying a page style provided by the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Referring to fig. 1, a method for modifying a page style according to an embodiment of the present invention includes steps S101-S102:
step S101: when style modification data are received, intercepting page style data of a first cssWatcher instance according to a modification object and a modification attribute, and assigning values to corresponding attribute data in the page style data according to the modification attribute value;
wherein the style modification data comprises a modification object, a modification attribute, and a modification attribute value; the page style data is bound with a corresponding page style of the cssWatcher file;
in this embodiment, before receiving the style modification data, the method further includes:
acquiring an input cssWatcher file, wherein the input cssWatcher file comprises data parameters;
creating a first cssWatcher instance in js according to the input cssWatcher file, the first cssWatcher instance comprising page style data;
assigning values to attribute data in the page style data according to the data parameters; and binding the corresponding page style in the cssWatcher file according to the attribute data of the page style data.
In the embodiment, a page item is created and then a cssWatcher.js file is introduced, wherein the cssWatcher.js file contains data parameters, and a corresponding cssWatcher instance is created in js according to the cssWatcher.js file, so that the data parameters are transferred to a constructor;
in this embodiment, according to the data parameter, assigning a value to attribute data in the page style data specifically includes:
converting the data parameters into data parameter character strings; assigning a value to the page style data according to the data parameter character string;
wherein the data parameters comprise all attribute data parameters; the page style data is created by dom, and the page style data is recorded by the text of the dom object.
In the embodiment, in the cssWatcher example, a data parameter is added under the body of a page, and the data parameter is converted into a data parameter character string;
illustratively, the data parameter value is { he i ght: '100px', co l or: 'red' }, and the data parameters are spliced into the following data parameter string according to the data parameter value: body { - -he i ght: '100px', - -co l or: 'red' };
in the cssWatcher example, an sty l e tag is created by dom to store page style data, and the data parameter string is assigned to the page style data of the sty l e tag.
In this embodiment, binding the corresponding page style in the csswatch file according to the attribute data of the page style data specifically includes:
according to the attribute data of the page style data, assigning a corresponding page attribute of the cssWatcher file through a var function to obtain a corresponding page style;
and when the attribute data of the style of the page style data is changed, assigning the corresponding page attribute of the cssWatcher file again through the var function to obtain a new page style.
In this embodiment, the attribute data of the page style data is a data parameter string: body { - -he i ght: '100px', - -co l or: 'red' };
assigning the corresponding page attribute of the cssWatcher. test { he i ght: var (- -he i ght) }; test { co l or: var (- -co l or) };
in this embodiment, intercepting the page style data of the first csswatch instance, and assigning a value to corresponding attribute data in the page style data according to a modified attribute value specifically includes:
intercepting page style data of a first cssWatcher instance through an interceptor, and obtaining an intercepted object of the page style data, a style attribute of the intercepted object, and a style attribute value of the intercepted object through a set function;
and executing a setSty l e method according to the modified attribute value, and assigning the modified attribute value to the style attribute value of the interception object of the page style data.
In the present embodiment, the modification data includes a modification object, a modification attribute, and a modification attribute value;
illustratively, when the style modification data is received, if the style modification data is: the modified object is: body, the modified attributes are: he i light and the modified attribute values are: 200px;
intercepting a data parameter string of page style data of a first cssWatcher instance by a Proxy interceptor, acquiring the data parameter string body { -he i right: '100px' of the page style data by assigning body [ he i right ] =200px by a set function of the Proxy interceptor, and executing a setSty l e method to change the data parameter string into body { -he i right: '200px' }.
Step S102: and according to the modified page style data, assigning a corresponding page attribute of the cssWatcher file to obtain a new page style.
In this embodiment, after the attribute value is modified and the style attribute value of the interception object of the page style data is given, the corresponding page attribute of the csswatch file is assigned by the var function according to the modified page style data, and a new page style is obtained.
In this embodiment, according to the data parameter string body { -he i right: '200px' } of the modified page style data, the modified data parameter string is assigned to the corresponding page attribute of the css watch. test { he i ght: var (- -he i ght) }; and obtaining a corresponding page style bound by the new cssWacher.js file according to the page attribute of the cssWacher.js file.
Therefore, when style modification data are received, a set function of the Proxy interceptor is triggered, the obtained modification data are assigned to the data parameter string of the page style data, the modified data parameter string automatically assigns the corresponding page attribute of the cssWatcher.
The embodiment of the invention has the following effects:
because the page style data is bound with the corresponding page style of the cssWatcher file, when style modification data is received, the corresponding page style of the cssWatcher file can be modified in a linkage manner only by intercepting the page style data of the first cssWatcher instance and modifying the corresponding style attribute value, the style modification mode is unified, the style modification is convenient, the page style can be modified only by intercepting the corresponding attribute value, the use of dom is reduced, the code amount is reduced, and the operation performance is optimized.
Example two
Referring to fig. 2, a device for modifying a page style provided by an embodiment of the present invention includes: an interception module 201 and a modification module 202;
the intercepting module 201 is configured to intercept, when style modification data is received, page style data of a first css watch instance according to a modification object and a modification attribute;
the modification module 202 is configured to assign a value to corresponding attribute data in the page style data according to a modified attribute value; the style modification data includes a modification object, a modification attribute, and a modification attribute value; the page style data is bound with a corresponding page style of the cssWatcher file; and according to the modified page style data, assigning a value to the corresponding page attribute of the cssWatcher file, and acquiring a new page style.
The device for modifying the page style provided by the embodiment of the invention also comprises: a creating module and a binding module;
the creating module is used for obtaining an input cssWatcher file, and the input cssWatcher file comprises data parameters; creating a first cssWatcher instance in js according to the input cssWatcher file, the first cssWatcher instance including page style data;
the binding module comprises: a parameter acquisition unit and a style acquisition unit;
the parameter acquisition unit is used for converting the data parameters into data parameter character strings; assigning a value to the page style data according to the data parameter character string; wherein the data parameters include all attribute data parameters; the page style data is created through dom, and the page style data is recorded by the text of a dom object;
the style acquisition unit is used for assigning a corresponding page attribute of the cssWatcher file through a var function according to the attribute data of the page style data to acquire a corresponding page style; and when the attribute data of the style of the page style data is changed, assigning the corresponding page attribute of the cssWatcher file again through the var function to obtain a new page style.
The modification module comprises an attribute modification unit and a style modification unit;
the attribute modification unit is used for executing a setSty l method according to a modification attribute value, and endowing the modification attribute value to a style attribute value of an interception object of the page style data;
and the style modification unit is used for assigning the modified attribute value to the style attribute value of the interception object of the page style data, and then assigning the corresponding page attribute of the cssWatcher file through a var function according to the modified page style data to obtain a new page style.
The device for modifying page styles can implement the method for modifying page styles in the embodiment of the method. The alternatives in the above-described method embodiments are also applicable to this embodiment and will not be described in detail here. The rest of the embodiments of the present application may refer to the contents of the above method embodiments, and in this embodiment, details are not described again.
The embodiment of the invention has the following effects:
because the page style data is bound with the corresponding page style of the cssWatcher file, when the style modification data is received, the interception module intercepts the page style data of the first cssWatcher instance, and modifies the corresponding style attribute value by the modification module, so that the corresponding page style of the cssWatcher file can be modified in a linkage manner, the style modification mode is unified, the style modification is convenient, the page style can be modified only by intercepting the corresponding attribute value, the use of dom is reduced, the code amount is reduced, and the operation performance is optimized.
EXAMPLE III
Accordingly, the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the method for modifying page styles according to any one of the above embodiments.
Illustratively, the computer program may be partitioned into one or more modules/units, stored in the memory and executed by the processor, to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program in the terminal device.
The terminal device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The terminal device may include, but is not limited to, a processor, a memory.
The Processor may be a Central Processing Unit (CPU), other general-purpose Processor, a Digital Signal Processor (DSP), an application specific integrated circuit (ASI C), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is the control center of the terminal device and connects the various parts of the whole terminal device using various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the terminal device by running or executing the computer programs and/or modules stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile terminal, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a flash memory Card (F l ash Card), at least one magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
Wherein, the terminal device integrated module/unit can be stored in a computer readable storage medium if it is implemented in the form of software functional unit and sold or used as a stand-alone product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments described above may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-drive, a removable hard drive, a magnetic diskette, an optical disk, a computer Memory, a Read-only Memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, etc.
The above-mentioned embodiments are provided to further explain the objects, technical solutions and advantages of the present invention in detail, and it should be understood that the above-mentioned embodiments are only examples of the present invention and are not intended to limit the scope of the present invention. It should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for modifying page styles, comprising:
when style modification data are received, intercepting page style data of a first cssWatcher instance according to a modification object and a modification attribute, and assigning values to corresponding attribute data in the page style data according to the modification attribute values;
wherein the style modification data comprises a modification object, a modification attribute, and a modification attribute value; the page style data is bound with a corresponding page style of the cssWatcher file;
and according to the modified page style data, assigning a corresponding page attribute of the cssWatcher file to obtain a new page style.
2. The method for modifying page style according to claim 1, wherein before receiving style modification data, further comprising:
acquiring an input cssWatcher file, wherein the input cssWatcher file comprises data parameters;
creating a first cssWatcher instance in js according to the input cssWatcher file, the first cssWatcher instance comprising page style data;
assigning values to attribute data in the page style data according to the data parameters; and binding the corresponding page style in the cssWatcher file according to the attribute data of the page style data.
3. The method for modifying a page style according to claim 2, wherein the assigning, according to the data parameter, to attribute data in the page style data is specifically:
converting the data parameters into data parameter character strings; assigning a value to the page style data according to the data parameter character string;
wherein the data parameters comprise all attribute data parameters; the page style data is created by dom, and the page style data is recorded by the text of the dom object.
4. The method for modifying a page style according to claim 2, wherein the binding of the corresponding page style in the csswatch file according to the attribute data of the page style data specifically includes:
according to the attribute data of the page style data, assigning the corresponding page attribute of the cssWatcher file through a var function to obtain a corresponding page style;
and when the attribute data of the style of the page style data is changed, re-assigning the corresponding page attribute of the cssWatcher file through the var function to acquire a new page style.
5. The method for modifying a page style according to claim 1, wherein the intercepting of the page style data of the first csswatch instance and the assigning of a value to corresponding attribute data in the page style data according to the modified attribute value are specifically:
intercepting page style data of a first cssWatcher instance through an interceptor, and obtaining an intercepted object of the page style data, a style attribute of the intercepted object, and a style attribute value of the intercepted object through a set function;
and executing a setStyle method according to the modification attribute value, and assigning the modification attribute value to the style attribute value of the interception object of the page style data.
6. The method for modifying a page style of claim 5, wherein after assigning the modification attribute value to the style attribute value of the intercepted object of the page style data, further comprising:
and according to the modified page style data, assigning the corresponding page attribute of the cssWatcher file through a var function to obtain a new page style.
7. An apparatus for modifying page styles, comprising: an interception module and a modification module;
the intercepting module is used for intercepting the page style data of the first cssWatcher instance according to the modification object and the modification attribute when receiving the style modification data;
the modification module is used for assigning values to corresponding attribute data in the page style data according to the modified attribute values; the style modification data includes a modification object, a modification attribute, and a modification attribute value; the page style data is bound with a corresponding page style of the cssWatcher file;
and according to the modified page style data, assigning a corresponding page attribute of the cssWatcher file to obtain a new page style.
8. The apparatus for modifying a page style of claim 7 further comprising: a creating module and a binding module;
the creating module is used for obtaining an input cssWatcher file, and the input cssWatcher file comprises data parameters; creating a first cssWatcher instance in js according to the input cssWatcher file, the first cssWatcher instance including page style data;
the binding module comprises: a parameter acquisition unit and a style acquisition unit;
the parameter acquisition unit is used for converting the data parameters into data parameter character strings; assigning a value to the page style data according to the data parameter character string; wherein the data parameters comprise all attribute data parameters; the page style data is created through dom and is recorded by using the text of a dom object;
the style acquisition unit is used for assigning a corresponding page attribute of the cssWatcher file through a var function according to the attribute data of the page style data to acquire a corresponding page style; and when the attribute data of the style of the page style data is changed, assigning the corresponding page attribute of the cssWatcher file again through the var function to obtain a new page style.
9. The apparatus for modifying page style according to claim 7, wherein said modification module comprises an attribute modification unit and a style modification unit;
the attribute modification unit is used for executing a setStyle method according to a modification attribute value and endowing the modification attribute value to a style attribute value of an interception object of the page style data;
and the style modification unit is used for assigning the modified attribute value to the style attribute value of the interception object of the page style data, and then assigning the corresponding page attribute of the cssWatcher file through a var function according to the modified page style data to acquire a new page style.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored computer program; wherein the computer program, when executed, controls an apparatus on which the computer-readable storage medium is located to perform a method of modifying page styles as claimed in any one of claims 1 to 6.
CN202211476125.2A 2022-11-23 2022-11-23 Method, device and storage medium for modifying page style Pending CN115756421A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211476125.2A CN115756421A (en) 2022-11-23 2022-11-23 Method, device and storage medium for modifying page style

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211476125.2A CN115756421A (en) 2022-11-23 2022-11-23 Method, device and storage medium for modifying page style

Publications (1)

Publication Number Publication Date
CN115756421A true CN115756421A (en) 2023-03-07

Family

ID=85336415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211476125.2A Pending CN115756421A (en) 2022-11-23 2022-11-23 Method, device and storage medium for modifying page style

Country Status (1)

Country Link
CN (1) CN115756421A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317570A (en) * 2014-09-29 2015-01-28 北京掌中经纬技术有限公司 Device and method for dynamically analyzing web application
CN106598610A (en) * 2016-12-19 2017-04-26 北京小米移动软件有限公司 Refreshing implementation method and device based on webpage application
CN110083790A (en) * 2019-04-30 2019-08-02 珠海随变科技有限公司 Page editing method, page output method, device, computer equipment and medium
CN111857803A (en) * 2020-07-20 2020-10-30 北京达佳互联信息技术有限公司 Page updating method, device, server and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317570A (en) * 2014-09-29 2015-01-28 北京掌中经纬技术有限公司 Device and method for dynamically analyzing web application
CN106598610A (en) * 2016-12-19 2017-04-26 北京小米移动软件有限公司 Refreshing implementation method and device based on webpage application
CN110083790A (en) * 2019-04-30 2019-08-02 珠海随变科技有限公司 Page editing method, page output method, device, computer equipment and medium
CN111857803A (en) * 2020-07-20 2020-10-30 北京达佳互联信息技术有限公司 Page updating method, device, server and storage medium

Similar Documents

Publication Publication Date Title
US11789715B2 (en) Systems and methods for transformation of reporting schema
US11461111B2 (en) Method for running applets, and electronic device
CN108984174B (en) Cross-platform application creation method, device, server and storage medium
US20240045850A1 (en) Systems and methods for database orientation transformation
CN111177113B (en) Data migration method, device, computer equipment and storage medium
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN111209001A (en) Method, system, equipment and medium for batch generation of APKs of android channels
CN111045686B (en) Method for improving decompilation speed of application, intelligent terminal and storage medium
CN110688145B (en) Android MVP code automatic generation method and device, medium and electronic equipment
CN112035230A (en) Method and device for generating task scheduling file and storage medium
CN111159301A (en) Data creating method, device, equipment and storage medium based on intelligent contract
CN112604273B (en) Data-driven game system function loading method, device and storage medium
CN113760242A (en) Data processing method, device, server and medium
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN103809915A (en) Read-write method and device of magnetic disk files
CN115756421A (en) Method, device and storage medium for modifying page style
CN115857934A (en) Method for generating form page according to configuration variable file
CN111078905A (en) Data processing method, device, medium and equipment
CN115167728A (en) Menu bar merging and displaying method, device and computer readable storage medium
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN113504904A (en) User-defined function implementation method and device, computer equipment and storage medium
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device
CN115269058B (en) WPF resource loading method and device
CN112214220B (en) Method, apparatus and device for integrated system
CN114461216B (en) File compiling method and device, electronic equipment and 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