CN113687880A - Method, device, equipment and medium for calling component - Google Patents
Method, device, equipment and medium for calling component Download PDFInfo
- Publication number
- CN113687880A CN113687880A CN202110959302.1A CN202110959302A CN113687880A CN 113687880 A CN113687880 A CN 113687880A CN 202110959302 A CN202110959302 A CN 202110959302A CN 113687880 A CN113687880 A CN 113687880A
- Authority
- CN
- China
- Prior art keywords
- component
- target
- project file
- calling
- attribute information
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method, a device, equipment and a medium for calling a component. The method comprises the following steps: processing a target project file corresponding to a current project to obtain at least one component to be used associated with the target project file; when the component to be used is detected to be used, calling a target component matched with the component to be used from a component storage library; and adding preset component attribute information corresponding to the target component to a target position in the target project file. The embodiment of the invention solves the problem of low development efficiency caused by the fact that the attributes of the components cannot be displayed when the components are called by the traditional method, reduces repeated development and improves development efficiency.
Description
Technical Field
Embodiments of the present invention relate to computer processing technologies, and in particular, to a method, an apparatus, a device, and a medium for calling a component.
Background
With the high-speed development of the mobile internet, various interface design frameworks and JavaScript libraries are layered endlessly, and the development difficulty is gradually improved.
Currently, a vue.js frame is one of main stream frames for front-end development, components are used in the development process, the components are used in a vscode development tool, the traditional method for calling the components needs to be familiar with the attributes of the components, some components have document information, the components are called by checking the document information, other components do not have the document information, the component source codes need to be checked for calling the component operation, and the traditional method for calling the components greatly reduces the development efficiency.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for calling a component, so as to realize accurate and efficient calling of the component.
In a first aspect, an embodiment of the present invention provides a method for calling a component, including:
processing a target project file corresponding to a current project to obtain at least one component to be used associated with the target project file;
when the component to be used is detected to be used, calling a target component matched with the component to be used from a component storage library;
and adding preset component attribute information corresponding to the target component to a target position in the target project file.
In a second aspect, an embodiment of the present invention further provides an apparatus for invoking a component, where the apparatus includes:
the component acquisition module is used for processing a target project file corresponding to a current project to obtain at least one component to be used associated with the target project file;
the component calling module is used for calling a target component matched with the component to be used from a component storage library when the component to be used is detected to be used;
and the attribute adding module is used for adding preset component attribute information corresponding to the target component to a target position in the target project file.
In a third aspect, an embodiment of the present invention further provides a device for invoking a component, where the device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method for invoking the components provided by any of the embodiments of the present invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for calling a component provided in any embodiment of the present invention.
The embodiment of the invention adds the preset component attribute information corresponding to the target component to the target position in the target project file, calls the target component matched with the component to be used from the component storage library, solves the problems that when the component is called at present, the component document corresponding to each component needs to be checked, and whether the component document is available is further determined according to the component document, when the number of the stored or used components is large, the file of each component is checked, and whether the component is called is further determined, the searching efficiency is low, and the labor cost is high, however, the technical scheme can display the attribute information corresponding to the component by installing the attribute prompt plug-in corresponding to the component, so that a user can quickly determine whether the component is the required component based on the displayed attribute information, therefore, convenience and efficiency of calling the components are improved, and efficiency of research and development projects is improved.
Drawings
Fig. 1 is a flowchart of a method for calling a component according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for invoking a component according to a second embodiment of the present invention;
fig. 3 is a block diagram of a device for calling a component according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a device for calling a component according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for calling a component according to an embodiment of the present invention, where this embodiment is applicable to a case where a component is called in front-end development, and the method may be executed by a device for calling a component according to an embodiment of the present invention, where the device may be implemented in a software and/or hardware manner, and optionally, the method is implemented by an electronic device, and the electronic device may be a mobile terminal, a PC end, a server end, or the like. The apparatus may be configured in a computing device, and the method for invoking a component provided in this embodiment specifically includes the following steps:
s110, processing a target project file corresponding to the current project to obtain at least one component to be used associated with the target project file.
The current project is software or application that is being developed by a project developer at a terminal using a development tool, the development tool may be vscode, and the development tool is not limited, the target project file refers to a file with specific content corresponding to the current project, and for example, the target project file may include program codes and used functional components corresponding to the current project. For example, in the development process, when a component for filling in basic information functions such as a user name, an age, and an address is implemented, related attribute data and a method for filling in the basic information may be encapsulated as a component corresponding to the basic information, that is, the component is a component capable of implementing the function of filling in the basic information. The component to be used refers to a component to be used in the current project development process, and the number of the used components can be one or more, that is, the number of the components to be used is at least one.
It should be noted that, in a specific application scenario, when a current item needs to be processed, some controls on the display interface may be triggered, for example, a control starts to be processed. When the trigger of the control is detected, the project file needing to be processed, namely the target project file corresponding to the current project, can be displayed.
It should also be noted that the target project file includes the program code associated with the current project and the components to be used required for implementing the current project.
Specifically, when a control triggering processing of the target project file is detected, the target project file may be analyzed, for example, program codes and used components in the target project file are extracted, and accordingly, a plurality of to-be-used components associated with the target project file may be obtained, and which positions in the program codes need to be imported into the to-be-used components may also be known.
In this embodiment, the obtaining at least one component to be used associated with the target project file by processing the target project file corresponding to the current project includes: and when the target project file corresponding to the current project is detected to be triggered, acquiring the characteristic value of each sub project file in the target project file and at least one component to be used associated with each sub project file.
The triggering of the target project file refers to triggering operation caused by clicking through a computer input device or stopping a cursor at the position of the target project file for a certain preset time, and the computer input device can be a mouse or a keyboard. The target project file is provided with a plurality of sub project files according to a plurality of specific functions implemented by the current project, each sub project file can store program codes corresponding to the specific functions, the sub project files can be one or more, for example, when the current project needs to implement deleting, adding and updating functions, sub file items corresponding to the deleting, adding and updating three functions can be set in the target project file defined by the current project, and the three sub file items respectively store codes for implementing the three functions. The feature value refers to a value having component attribute information in each child project file, and the feature value may be one or more. When the target project file is triggered, the characteristic value information of the corresponding component can be acquired, so that the time overhead is saved, and the development efficiency is improved.
And S120, when the component to be used is detected to be used, calling a target component matched with the component to be used from a component storage library.
Wherein the component repository stores a plurality of components. Before the technical scheme is implemented, each data and the corresponding method can be subpackaged in advance to obtain a plurality of components, and the components packaged in advance can be stored in a component library for the convenience of subsequent component calling. Namely, the temporary storage control for temporarily storing each packaged component in the component storage library. The component repository may be built in the terminal or located in the cloud server, and the storage location of the component repository is not limited herein. The target component refers to a component which is obtained according to a target project file corresponding to the current project and is matched with the attribute of the component to be used. I.e. the target component matching the property of the component to be used is called from the component repository.
It should be noted that, in a specific application scenario, when it is detected that the component to be used is used, the target program code of the target file may be optimized, some components to be used are required to be used in the process of running the code, or a field is detected in the process of further processing the target program code, and when a certain component is required to be used in the field, the condition that the component to be used is used may be detected.
It should also be noted that the components to be used include properties and methods for implementing certain specific functions of the current item.
Specifically, when it is detected that the component to be used is used in the target program code, the attribute of the component to be used may be processed, for example, a feature value of the attribute of the component to be used is extracted, and accordingly, feature values of attributes of a plurality of components to be used associated with the target program code may be obtained.
Optionally, when the component to be used is detected to be used, invoking a target component matching the component to be used from a component repository, including: when the component to be used is detected to be used in the target program code, determining a target component corresponding to the characteristic value from the component storage according to the characteristic value of the component to be used.
The object program code refers to a code segment having a certain function in each sub-project file in the object project file, for example, the object program code may be a code corresponding to the current project and writing a calling component in each sub-project file for implementing a certain specific function. By obtaining the characteristic values of the components to be used associated with the sub-project files, the characteristic values stored in the component repository are compared with the characteristic values of the components to be used, and the target components corresponding to the characteristic values in the component repository are determined, so that the target components can be directly called in the following process, and the whole development efficiency is improved. It should be noted that, in a specific application scenario, before the target component matching the component to be used is called from the component repository, the target component matching the component to be used may be processed, for example, if the target component already exists in the target cache repository, the target component does not need to be called from the component repository, if the target component does not exist in the target cache repository, the target component needs to be called from the component repository, that is, before the target component matching the component to be used is called from the component repository, whether the target component is included in the target cache repository may be determined and processed.
It should also be noted that the target components matched with the components to be used may be stored in the target cache library and the component storage library.
Specifically, before the target component matched with the component to be used is called from the component repository, it may be determined whether the target component is included in the target cache repository, if so, the target component does not need to be called from the component repository, and if not, the target component needs to be called from the component repository.
Optionally, before the calling the target component matching the component to be used from the component repository, the method further includes: determining whether the target component is included in a target cache library; the target cache library is used for temporarily storing the called components corresponding to the project files; if not, calling a target component matched with the component to be used from a component repository; and if so, calling the target component from the target cache library.
The called component is a historical component acquired by triggering the project file, whether a target component matched with the component to be used is included in the target cache library is determined by determining whether the target component is stored in the target cache library, if the target component is stored in the target cache library, the target component can be directly called from the target cache library without calling the target component from the component storage library, if the target component is not stored in the target cache library, the target component needs to be called from the component storage library, and in order to finally store the target component in the target cache library, judgment processing is performed in advance, so that development efficiency is improved.
It should be noted that, in a specific application scenario, after the target component matching the component to be used is called from the component repository, the target component matching the component to be used may be processed, where the target component is a component determined from the component repository according to the feature value of the component to be used, and corresponds to the feature value, for example, when it is determined that the target component is not included in the target cache library, the target component matching the component to be used is called from the component repository, and may be directly called in the target cache library for next use of the target component without calling the target component by traversing the global component in the component repository, and optionally, the target component called by the global component in the component repository and the feature value corresponding to the target component may be correspondingly stored in the target cache library, the component can be conveniently and subsequently called directly through the target cache library.
It should also be noted that the target component includes attributes and methods that implement certain specific functions of the current project.
Specifically, after the target component matched with the component to be used is called from the component repository, the target component matched with the component to be used may be stored, for example, the target component and the feature value corresponding to the target component are extracted, and correspondingly, the target component and the feature value corresponding to the target component may be stored in the target cache repository correspondingly.
Optionally, after the target component matching the component to be used is called from the component repository, the method further includes storing the target component and the feature value corresponding to the target component into the target cache repository correspondingly.
And then storing the target component and the characteristic value corresponding to the target component in a target cache library, so that the reuse rate of the component is reduced, and the development efficiency is greatly improved.
S130, adding preset component attribute information corresponding to the target component to a target position in the target project file.
The component attribute information refers to component attribute information which is obtained from a target project file corresponding to the current project and is matched with the attributes of the components to be used. For example, after determining the attribute information of the component to be used, the attribute information matching the attribute information of the component to be used needs to be extracted from the target component and used as the preset component attribute information. Alternatively, the target component may be obtained from a target cache library or component repository. The target location refers to a specific location of the code in the target project file to which the component is called.
It should be noted that, when adding preset component attribute information corresponding to the target component to the target position in the target item file, the component attribute information adding operation may be performed according to the condition for determining whether the cursor triggers the target component or not and the position relationship between the cursor position and the target position.
Specifically, the component attribute information corresponding to the target component is preset, and the component attribute information is added to the target position in the target project file according to the position relationship between the cursor position and the target position and whether the cursor triggers the target component.
Optionally, when it is detected that the cursor position is the same as the position of the target component, displaying component attribute information corresponding to the target component; when the target component is detected to be triggered, adding the component attribute information of the target component to a target position in the target project file. By displaying the component attribute information corresponding to the target component in time and adding the component attribute information of the target component to the target position in the target project file, the reusability and flexibility of the component are improved.
On the basis of the operation, the components required to be used for retrieving the current project from the component repository can be packaged in advance to obtain the components. Optionally, at least one component to be used is encapsulated, wherein the component to be used is used for realizing a specific function.
The components to be used refer to components used in the current project development process, the packaging components refer to properties and implementation codes of hidden components, and only the interfaces are externally disclosed to control the access level of reading and modifying the properties in the program. The packaging of the component to be used may be to combine the obtained component attribute information and the source code of the operation component attribute to form a "class", where the class may include data and functions, for example, the package component may be an object class, the object class includes data members and member functions, the data members correspond to the attributes of the component, and the member functions are used to define the attributes of the class, for example, the object class internally packages a function including information about the behavior mode of the member and defining the behavior mode of the member, where the information includes the name, the attribute, the method, and the event information of the member. Namely, the encapsulation of the component to be used is the encapsulation of the component attribute information and the source code for operating the component attributes.
And optionally, determining component attribute information of each component to be used, setting a plug-in corresponding to each component to be used, displaying the component attribute information of the corresponding component to be used based on the plug-in, and adding the component attribute information of the target component to a target position in the program code when the target component is determined. The plug-in is a program written by the components according to a certain specific function, can simultaneously support a plurality of development tool platforms specified by the program to run, and processes files with certain specific function requirements. That is, a component with a reserved interface in an application may be called a plug-in, for example, in an IE browser, after installing a relevant plug-in of a specific type, a WEB browser can directly call the plug-in for processing a file of the specific type. The package assembly is adopted, the plug-in corresponding to the assembly is arranged, and the method for displaying the assembly attribute information of the corresponding assembly by using the plug-in enhances the development safety and simplifies the programming.
The embodiment of the invention adds the preset component attribute information corresponding to the target component to the target position in the target project file, calls the target component matched with the component to be used from the component storage library, solves the problems that when the component is called at present, the component document corresponding to each component needs to be checked, and whether the component document is available is further determined according to the component document, when the number of the stored or used components is large, the file of each component is checked, and whether the component is called is further determined, the searching efficiency is low, and the labor cost is high, however, the technical scheme can display the attribute information corresponding to the component by installing the attribute prompt plug-in corresponding to the component, so that a user can quickly determine whether the component is the required component based on the displayed attribute information, therefore, convenience and efficiency of calling the components are improved, and efficiency of research and development projects is improved.
Example two
As an alternative embodiment of the foregoing embodiment, fig. 2 is a flowchart of a method for invoking a component according to a second embodiment of the present invention, which may be specifically referred to in the following.
Referring to fig. 2, a target project file corresponding to a current project is called an vue file, referring to block 1, a vue file is opened, a vue file is analyzed, whether a component is required to be used by reference of the vue file is judged, if not, the process is ended, if yes, the process returns to vue file analysis processing operation, and the analysis result is analyzed next. And referring to a frame 2, detecting a component to be used, searching component attribute information, further searching whether the searched component attribute information is contained in a target cache library of the cache component attribute, returning a search result, if the search result is that the component attribute information is found, displaying corresponding component attribute information at the position of a cursor, if the search result is that the component attribute information is not found, returning to a component repository, performing global search on the component attribute information, if the component attribute information is not found, ending the process, if the component attribute information is found, prompting the corresponding component attribute information, and adding the found component attribute information to the target cache library, so that a developer can directly call the component in the target cache library in the next use process, and the overhead of global search is reduced.
In the embodiment of the invention, the component attribute information is stored by detecting the component to be used and according to whether the component to be used is stored in the target storage library, the preset component attribute information corresponding to the target component is added to the target position in the target project file, and the required component attribute information is encapsulated for the subsequent development and use of developers.
According to the technical scheme of the embodiment, at least one component to be used associated with a target project file is obtained by processing the target project file corresponding to a current project; when the component to be used is detected to be used, calling a target component matched with the component to be used from a component storage library; and adding preset component attribute information corresponding to the target component to a target position in the target project file. The problems that when the number of the stored or used components is large, when the documents of all the components are checked and whether the components are called is determined, the searching efficiency is low and the labor cost is high are solved.
EXAMPLE III
Fig. 3 is a block diagram of a device for calling a component according to a third embodiment of the present invention. The device includes: a component acquisition module 310, a component calling module 320, and an attribute adding module 330.
The component acquiring module 310 is configured to obtain at least one component to be used, which is associated with a target project file, by processing the target project file corresponding to a current project;
a component calling module 320, configured to, when it is detected that the component to be used is used, call a target component matching the component to be used from a component repository;
the attribute adding module 330 is configured to add preset component attribute information corresponding to the target component to a target position in the target project file.
The embodiment of the invention adds the preset component attribute information corresponding to the target component to the target position in the target project file, calls the target component matched with the component to be used from the component storage library, solves the problems that when the component is called at present, the component document corresponding to each component needs to be checked, and whether the component document is available is further determined according to the component document, when the number of the stored or used components is large, the file of each component is checked, and whether the component is called is further determined, the searching efficiency is low, and the labor cost is high, however, the technical scheme can display the attribute information corresponding to the component by installing the attribute prompt plug-in corresponding to the component, so that a user can quickly determine whether the component is the required component based on the displayed attribute information, therefore, convenience and efficiency of calling the components are improved, and efficiency of research and development projects is improved.
In the above apparatus, optionally, the component obtaining module 310 is specifically configured to: and when the target project file corresponding to the current project is detected to be triggered, acquiring the characteristic value of each sub project file in the target project file and at least one component to be used associated with each sub project file.
In the foregoing apparatus, optionally, the component invoking module 320 is specifically configured to: when the component to be used is detected to be used in the target program code, determining a target component corresponding to the characteristic value from the component storage according to the characteristic value of the component to be used.
In the above apparatus, optionally, the attribute adding module 330 is specifically configured to: when the cursor position is detected to be the same as the position of the target component, displaying component attribute information corresponding to the target component; when the target component is detected to be triggered, adding the component attribute information of the target component to a target position in the target project file.
In the above apparatus, optionally, the apparatus further includes: a cache library determination module to determine whether the target component is included in a target cache library; the target cache library is used for temporarily storing the called components corresponding to the project files; if not, calling a target component matched with the component to be used from a component repository; and if so, calling the target component from the target cache library.
In the above apparatus, optionally, the apparatus further includes: the to-be-used component packaging module is used for packaging at least one to-be-used component; wherein the component to be used is used for realizing a specific function; determining component attribute information of each component to be used, setting a plug-in corresponding to each component to be used, and displaying the component attribute information of the corresponding component to be used based on the plug-in so as to add the component attribute information of the target component to a target position in the program code when the target component is determined.
The device for calling the component provided by the embodiment of the invention can execute the method for calling the component provided by any embodiment of the invention, and has the corresponding functional module and beneficial effect of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a device for calling a component according to a fourth embodiment of the present invention. FIG. 4 shows a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The electronic device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the electronic device 40, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, the electronic device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing, for example, a method of calling a component provided by an embodiment of the present invention, by executing a program stored in the system memory 402.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for invoking a component, the method including:
processing a target project file corresponding to a current project to obtain at least one component to be used associated with the target project file;
when the component to be used is detected to be used, calling a target component matched with the component to be used from a component storage library;
and adding preset component attribute information corresponding to the target component to a target position in the target project file.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having 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. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. A method of calling a component, comprising:
processing a target project file corresponding to a current project to obtain at least one component to be used associated with the target project file;
when the component to be used is detected to be used, calling a target component matched with the component to be used from a component storage library;
and adding preset component attribute information corresponding to the target component to a target position in the target project file.
2. The method of claim 1, wherein the obtaining at least one component to be used associated with the target project file by processing the target project file corresponding to the current project comprises:
and when the target project file corresponding to the current project is detected to be triggered, acquiring the characteristic value of each sub project file in the target project file and at least one component to be used associated with each sub project file.
3. The method of claim 1, wherein when the use of the component to be used is detected, the calling the target component matching the component to be used from a component repository comprises:
when the component to be used is detected to be used in the target program code, determining a target component corresponding to the characteristic value from the component storage according to the characteristic value of the component to be used.
4. The method according to claim 1, wherein the adding preset component attribute information corresponding to the target component to the target position in the target project file comprises:
when the cursor position is detected to be the same as the position of the target component, displaying component attribute information corresponding to the target component;
when the target component is detected to be triggered, adding the component attribute information of the target component to a target position in the target project file.
5. The method according to claim 1, further comprising, before said calling a target component matching the component to be used from a component repository:
determining whether the target component is included in a target cache library; the target cache library is used for temporarily storing the called components corresponding to the project files;
if not, calling a target component matched with the component to be used from a component repository;
and if so, calling the target component from the target cache library.
6. The method of claim 5, further comprising, after the calling the target component matching the component to be used from the component repository:
and correspondingly storing the target component and the characteristic value corresponding to the target component into the target cache library.
7. The method of claim 1, further comprising:
packaging at least one component to be used; wherein the component to be used is used for realizing a specific function;
determining component attribute information of each component to be used, setting a plug-in corresponding to each component to be used, and displaying the component attribute information of the corresponding component to be used based on the plug-in so as to add the component attribute information of the target component to a target position in the program code when the target component is determined.
8. An apparatus for invoking a component, comprising:
the component acquisition module is used for processing a target project file corresponding to a current project to obtain at least one component to be used associated with the target project file;
the component calling module is used for calling a target component matched with the component to be used from a component storage library when the component to be used is detected to be used;
and the attribute adding module is used for adding preset component attribute information corresponding to the target component to a target position in the target project file.
9. An apparatus for invoking a component, the apparatus comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of calling a component as recited in any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of invoking a component according to any one of claims 1-7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110959302.1A CN113687880B (en) | 2021-08-20 | 2021-08-20 | Method, device, equipment and medium for calling component |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110959302.1A CN113687880B (en) | 2021-08-20 | 2021-08-20 | Method, device, equipment and medium for calling component |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113687880A true CN113687880A (en) | 2021-11-23 |
| CN113687880B CN113687880B (en) | 2024-08-06 |
Family
ID=78580978
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110959302.1A Active CN113687880B (en) | 2021-08-20 | 2021-08-20 | Method, device, equipment and medium for calling component |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113687880B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117850756A (en) * | 2023-11-17 | 2024-04-09 | 深圳微米信息服务有限公司 | Management system and method for WEB front-end component |
Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060282417A1 (en) * | 2005-06-13 | 2006-12-14 | Canon Kabushiki Kaisha | File management apparatus, control method therefor, computer program, and computer-readable storage medium |
| CN105468227A (en) * | 2014-09-12 | 2016-04-06 | 北京畅游天下网络技术有限公司 | Method and apparatus for displaying information in webpage |
| CN109739497A (en) * | 2018-12-06 | 2019-05-10 | 深圳市中农网有限公司 | Page development method, apparatus, computer equipment and storage medium |
| EP3525090A1 (en) * | 2018-02-13 | 2019-08-14 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method and apparatus for launching application page, and electronic device |
| CN110308836A (en) * | 2019-06-24 | 2019-10-08 | 北京字节跳动网络技术有限公司 | A kind of data processing method, device, terminal and storage medium |
| WO2020233078A1 (en) * | 2019-05-21 | 2020-11-26 | 深圳壹账通智能科技有限公司 | User information form construction method, apparatus and device, and storage medium |
| CN112307408A (en) * | 2020-11-24 | 2021-02-02 | 微医云(杭州)控股有限公司 | Method and device for determining element information in page, electronic equipment and storage medium |
| CN112631566A (en) * | 2020-12-28 | 2021-04-09 | 航天信息股份有限公司 | Code generation method and device, storage medium and electronic equipment |
| CN112965940A (en) * | 2021-03-04 | 2021-06-15 | 中国邮政储蓄银行股份有限公司 | Project file display method and device, electronic equipment and processor |
| CN113051514A (en) * | 2021-03-26 | 2021-06-29 | 挂号网(杭州)科技有限公司 | Element positioning method and device, electronic equipment and storage medium |
| CN113239672A (en) * | 2021-05-18 | 2021-08-10 | 北京京东振世信息技术有限公司 | Target file editing method and device, electronic equipment and storage medium |
-
2021
- 2021-08-20 CN CN202110959302.1A patent/CN113687880B/en active Active
Patent Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060282417A1 (en) * | 2005-06-13 | 2006-12-14 | Canon Kabushiki Kaisha | File management apparatus, control method therefor, computer program, and computer-readable storage medium |
| CN105468227A (en) * | 2014-09-12 | 2016-04-06 | 北京畅游天下网络技术有限公司 | Method and apparatus for displaying information in webpage |
| EP3525090A1 (en) * | 2018-02-13 | 2019-08-14 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method and apparatus for launching application page, and electronic device |
| CN109739497A (en) * | 2018-12-06 | 2019-05-10 | 深圳市中农网有限公司 | Page development method, apparatus, computer equipment and storage medium |
| WO2020233078A1 (en) * | 2019-05-21 | 2020-11-26 | 深圳壹账通智能科技有限公司 | User information form construction method, apparatus and device, and storage medium |
| CN110308836A (en) * | 2019-06-24 | 2019-10-08 | 北京字节跳动网络技术有限公司 | A kind of data processing method, device, terminal and storage medium |
| CN112307408A (en) * | 2020-11-24 | 2021-02-02 | 微医云(杭州)控股有限公司 | Method and device for determining element information in page, electronic equipment and storage medium |
| CN112631566A (en) * | 2020-12-28 | 2021-04-09 | 航天信息股份有限公司 | Code generation method and device, storage medium and electronic equipment |
| CN112965940A (en) * | 2021-03-04 | 2021-06-15 | 中国邮政储蓄银行股份有限公司 | Project file display method and device, electronic equipment and processor |
| CN113051514A (en) * | 2021-03-26 | 2021-06-29 | 挂号网(杭州)科技有限公司 | Element positioning method and device, electronic equipment and storage medium |
| CN113239672A (en) * | 2021-05-18 | 2021-08-10 | 北京京东振世信息技术有限公司 | Target file editing method and device, electronic equipment and storage medium |
Non-Patent Citations (1)
| Title |
|---|
| 朱广福,王芳主编: "Web前端开发", 31 October 2020, 西南交通大学出版社, pages: 1 * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117850756A (en) * | 2023-11-17 | 2024-04-09 | 深圳微米信息服务有限公司 | Management system and method for WEB front-end component |
| CN117850756B (en) * | 2023-11-17 | 2024-08-09 | 深圳微米信息服务有限公司 | Management system and method for WEB front-end component |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113687880B (en) | 2024-08-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111680253B (en) | Page application data packet generation method and device, computer equipment and storage medium | |
| CN110865888B (en) | Resource loading method and device, server and storage medium | |
| CN113126990B (en) | Page development method, device, equipment and storage medium | |
| CN113419740B (en) | Program data stream analysis method and device, electronic equipment and readable storage medium | |
| CN115599386A (en) | Code generation method, device, equipment and storage medium | |
| CN114077430A (en) | Interface generation method, device, electronic device and storage medium | |
| CN114003269A (en) | Component processing method and device, electronic equipment and storage medium | |
| CN113051514B (en) | Element positioning method and device, electronic equipment and storage medium | |
| CN111124371A (en) | Game-based data processing method, device, equipment and storage medium | |
| CN110764941A (en) | Method, device, medium and equipment for acquiring call stack frame instruction offset | |
| US9026612B2 (en) | Generating a custom parameter rule based on a comparison of a run-time value to a request URL | |
| CN119149049A (en) | Source code static analysis method, device, equipment and storage medium | |
| CN113127050B (en) | Application resource packaging process monitoring method, device, equipment and medium | |
| CN114296705A (en) | Application package generation method and device, electronic equipment and storage medium | |
| CN113885998A (en) | Page rendering method and device, electronic equipment and storage medium | |
| CN114461214B (en) | A page display method, device, electronic device and storage medium | |
| CN113687880B (en) | Method, device, equipment and medium for calling component | |
| CN111506380A (en) | Rendering method, device, equipment and storage medium | |
| CN112748930B (en) | Compilation detection method, device, equipment and storage medium | |
| CN110888641A (en) | Automatic script generation method and device, server and storage medium | |
| CN113378517B (en) | Data dictionary generation method, device, electronic device and storage medium | |
| CN113282293B (en) | Code identification method, device, equipment and storage medium | |
| CN113656044B (en) | Android installation package compression method and device, computer equipment and storage medium | |
| US8843896B2 (en) | Metamodeling contextual navigation of computer software applications | |
| CN112068814B (en) | Method, device, system and medium for generating executable file |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |