UI component library calling method and device, electronic equipment and computer readable medium
By obtaining the component library name and address of the UI component library and calling the UI component library that is independent of the development project, the problem of low component calling efficiency in UI interface development is solved, and efficient UI interface generation is achieved.
Patent Information
- Application Number
- CN202110130105.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2041-05-07
AI Technical Summary
In UI development, all UI component elements are located within the current development project, resulting in low development efficiency.
By obtaining the component library name and address of the UI component library, a UI component library independent of the development project is called, and a UI interface is generated based on the UI components in the UI component library.
It enables flexible UI component library calls, improves development efficiency, and allows various development projects to make efficient use of the UI component library.
Smart Images

Figure CN114816396B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of component library invocation technology. More specifically, this application relates to a UI component library invocation method, apparatus, electronic device, and computer-readable medium. Background Technology
[0002] In UI development scenarios, the UI component elements used to build the interface are usually all located in the UI development project. Therefore, during the UI development process, the use of UI component elements is limited by the current development project, which affects development efficiency. Summary of the Invention
[0003] This application provides a method, device, electronic device, and computer-readable medium for calling a UI component library, which addresses the technical problem of component calls affecting development efficiency during interface development.
[0004] Firstly, a method for calling a UI component library is provided, which includes:
[0005] Get the component library name and address of the UI component library. The UI component library runs independently outside the current project.
[0006] Call the UI component library based on the component library name and component library address;
[0007] The UI interface is generated based on UI components in the UI component library and the current project.
[0008] Secondly, a UI component library invocation device is provided, the device comprising:
[0009] The module is used to obtain the component library name and address of the UI component library. The UI component library runs independently outside the current project.
[0010] The calling module is used to call the UI component library based on the component library name and component library address;
[0011] The UI generation module is used to generate UI interfaces based on UI components in the UI component library from the current project.
[0012] Thirdly, an electronic device is provided, the electronic device comprising:
[0013] One or more processors;
[0014] Memory;
[0015] One or more applications, wherein the applications are stored in memory and configured to be executed by one or more processors, the applications being configured to: execute UI component library invocation methods as shown in the first aspect of this application.
[0016] For example, in a third aspect of this application, a computing device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;
[0017] The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the UI component library calling method as shown in the first aspect of this application.
[0018] Fourthly, a computer-readable medium is provided having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the UI component library invocation method as shown in the first aspect of this application.
[0019] For example, in a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the UI component library calling method shown in the first aspect of this application.
[0020] The beneficial effects of the technical solution provided in this application are:
[0021] This application obtains the component library name and address of a UI component library, and then calls a UI component library independent of the development project based on the component library name and address. This allows for the generation of a UI interface based on the UI components in the current development project. This enables flexible calling of the UI component library, thus avoiding the limitation of only calling UI components within the development project. Therefore, each development project can efficiently utilize the UI component library, thereby improving development efficiency. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0023] Figure 1 This is one of the flowcharts illustrating a UI component library invocation method provided in this embodiment of the disclosure;
[0024] Figure 2 A second flowchart illustrating a UI component library invocation method provided in this embodiment of the disclosure;
[0025] Figure 3 This is one of the structural schematic diagrams of a UI component library calling device provided in an embodiment of the present disclosure;
[0026] Figure 4 This is a second schematic diagram of a UI component library calling device provided in an embodiment of the present disclosure;
[0027] Figure 5 This is a schematic diagram of the structure of an electronic device that calls a UI component library, as provided in an embodiment of this disclosure. Detailed Implementation
[0028] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0029] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0030] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0031] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish between devices, modules or units, and are not intended to limit these devices, modules or units to necessarily be different devices, modules or units, nor are they intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0033] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0034] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0035] In UI development scenarios, the UI component elements used to build the interface are usually all located in the UI development project. Therefore, during the UI development process, the use of UI component elements is limited by the current development project, which affects development efficiency.
[0036] The UI component library calling method, apparatus, electronic device, and computer-readable storage medium provided in this application aim to solve the aforementioned technical problems of the prior art. By obtaining the component library name and address, and calling the UI component library independent of the development project based on the component library name and address, a UI interface is generated through the current development project based on the UI components in the UI component library. This enables flexible calling of the UI component library, thus not being limited to calling only UI components within the development project. Therefore, each development project can efficiently utilize the UI component library, thereby improving development efficiency.
[0037] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0038] This disclosure provides a method for calling a UI component library. The execution subject of this method can be various terminal devices or server devices with interface development capabilities, or it can be a device or chip integrated on these devices, such as a computer device used for developing user interfaces. Figure 1 As shown, this is one of the flowcharts illustrating a UI component library invocation method provided in this embodiment of the disclosure. The method includes the following steps:
[0039] S101: Get the component library name and component library address of the UI component library.
[0040] S102: Call the UI component library based on the component library name and component library address.
[0041] S103: Generates a UI interface based on UI components in the UI component library using the current project.
[0042] Specifically, in this embodiment, the UI component library runs independently outside the current project. The current project can be the project developing the user interface. When building the user interface, the current project and other projects can choose to call the UI component library based on the UI components required by the user interface. For example, when the UI component library contains the UI components needed to build the user interface—that is, when the component type of the required UI component matches the component type information of the UI components contained in the UI component library—the UI component library can be called.
[0043] When the above calling conditions are met, the UI component library can be called based on the component library name and UI component address.
[0044] Specifically, the UI component library can include script files and component property files for each UI component.
[0045] The script file can include component type information for the corresponding UI components. For example, the UI component type can include buttons, dropdown lists, rectangles, background images, etc. Additionally, the component property file can include, for example, a C++ language file, which can include component property information for the corresponding UI components. For example, component property information can include color information, shape information, size parameters, etc.
[0046] Therefore, after calling the UI component library as described above, the script file and component property file corresponding to the UI component in the called UI component library can be read. Based on the component type information included in the script file and the component property information included in the component property file, the UI component in the called UI component library can be rendered to generate the UI interface.
[0047] This application obtains the component library name and address of a UI component library, and then calls a UI component library independent of the development project based on the component library name and address. This allows for the generation of a UI interface based on the UI components in the current development project. This enables flexible calling of the UI component library, thus avoiding the limitation of only calling UI components within the development project. Therefore, each development project can efficiently utilize the UI component library, thereby improving development efficiency.
[0048] In one embodiment of this disclosure, a possible implementation is provided, such as Figure 2 As shown, this is a second flowchart illustrating a UI component library calling method provided in this embodiment of the disclosure. Figure 2 As shown above, in the above Figure 1 Based on the illustrated embodiment, the user interface generation provided in this embodiment may further include the following steps:
[0049] S200: Generate component type files based on the script files corresponding to each UI component. Then, generate a UI component library based on the component type files and the component property files that describe the component properties of each UI component.
[0050] Specifically, the script file should include at least the component type information of the corresponding UI component.
[0051] Before step S101 in the above embodiment, this disclosure embodiment may further include step S200. Specifically, each UI component constituting the UI component library may correspond to a script file. For example, the script file may be a QML file, wherein the script file includes component type information of the UI component corresponding to the script file. For example, the component type of the UI component corresponding to the script file may include a button, a drop-down list, a rectangle, a background image, etc.
[0052] Furthermore, based on the script files corresponding to each UI component, a component type file is generated. Specifically, the component type file may include the component library name, the version information of the UI component library, the script files corresponding to each UI component and the paths of each script file, as well as the calling methods of each UI component.
[0053] Furthermore, the structure of the component type file can conform to the specifications of the user interface application development framework, so that when the interface development project calls the UI component library during the interface development process, the user interface application development framework can recognize the component type file and the UI components corresponding to the various script files contained in the component type file.
[0054] In addition, the UI component library may also include component property files. For example, the component property file may include a C++ language file, which contains component property information of the corresponding UI component. For example, the component property information may include the UI component's color information, shape information, size parameter information, etc.
[0055] Therefore, based on the aforementioned component type files and component attribute files, and by encapsulating the code files constituting the UI component library, a UI component library is generated. Thus, the UI component library generated in this embodiment can serve as an independent sub-project for the interface development project, so that the interface development project does not need to generate UI components or UI component libraries again when developing the interface, realizing the reusability of the component library. Furthermore, when the interface development project calls components, it is not limited to calling only the components within the project, thus improving the efficiency of interface development.
[0056] S201: When the component type of the UI component to be called matches the component type information of the corresponding UI component in the UI component library, the address of the component type file is obtained from the preset address list.
[0057] Specifically, the current project can pre-define the component type information of the UI components corresponding to the UI component library. For example, the current project can pre-define a mapping table of each UI component and the library to which it belongs. Therefore, when building the user interface, the current project can query the required UI components in the pre-define mapping table and select to call the UI component library. For example, when the UI component library contains the UI components needed to build the user interface, that is, when the component type of the required UI component matches the component type information of the UI components contained in the UI component library, the UI component library can be called.
[0058] It should be noted that the above-mentioned determination of whether the component type of the called UI component matches the component type information of the UI components contained in the UI component library can include the following two cases. For example, if the component type of the UI component to be called in the current project is a circular button, and the corresponding relationship table records that the UI component library contains a circular button, this can be considered a match. Alternatively, the UI component library can contain a UI component of the same type as the UI component to be called in the current project. For example, if the component type of the UI component to be called in the current project is a circular button, and the corresponding relationship table records that the UI component library contains a button, this can also be considered a match. After the current project subsequently calls the UI component library, the button contained in the UI component library can be configured as the circular button to be called.
[0059] Before calling the UI component library, you can first obtain the address of the component type file from the current project's preset address list. For example, the preset address list can be an import address list, which can be used to cache the address of the script file corresponding to the UI component. Furthermore, the import address list can include the addresses of multiple script files.
[0060] S202: Determine the component library address based on the root path in the path chain contained in the component type file's address; obtain the component type file based on its address to get the component library name.
[0061] Specifically, after obtaining the address of the component type file as described above, the component library name and component library address can be obtained based on the address of the component type file.
[0062] Specifically, the above list of import addresses can include pre-registered component type file addresses. The root path in the path chain of component type file addresses can be the component library address of the UI component library. For example, if the path chain of component type file addresses is EMUIKit / FilePanel / qmldir in C:\Projects, then the EMUIKit folder in C:\Projects, which is the root path in the EMUIKit / FilePanel / qmldir path chain, is the component library address of the UI component library.
[0063] In addition, the component type file can also include the component library name. Therefore, the component type file can be obtained based on its address, and the component library name of the UI component library can be read from the component type file.
[0064] S203: Call the UI component library based on the component library name and component library address.
[0065] S204: Obtain the script file and component property file corresponding to the UI component to be called in the UI component library; based on the component type information included in the script file and the component property information included in the component property file, render the UI component to be called in the UI component library to generate the UI interface.
[0066] Specifically, the UI component library can include script files and component property files for each UI component.
[0067] The script file can include component type information for the corresponding UI components. For example, the UI component type can include buttons, dropdown lists, rectangles, background images, etc. Additionally, the component property file can include, for example, a C++ language file, which can include the corresponding UI component's property information, such as color, shape, and size parameters.
[0068] Therefore, after calling the UI component library as described above, the script files and component property files corresponding to the UI components in the UI component library can be read. Based on the component type information included in the script files and the component property information included in the component property files, the UI components in the UI component library can be rendered to generate the UI interface.
[0069] This application obtains the component library name and address of a UI component library, and then calls a UI component library independent of the development project based on the component library name and address. This allows for the generation of a UI interface based on the UI components in the current development project. This enables flexible calling of the UI component library, thus avoiding the limitation of only calling UI components within the development project. Therefore, each development project can efficiently utilize the UI component library, thereby improving development efficiency.
[0070] This application provides a UI component library calling device, such as... Figure 3 As shown, this is one of the structural schematic diagrams of a UI component library calling device provided in an embodiment of this disclosure. The device 30 may include: an acquisition module 301, a calling module 302, and an interface generation module 303, wherein...
[0071] Module 301 is used to obtain the component library name and component library address of the UI component library.
[0072] Specifically, in this embodiment, the UI component library runs independently outside the current project. The current project can be the project developing the user interface. When building the user interface, the current project and other projects can choose to call the UI component library based on the UI components required by the user interface. For example, when the UI component library contains the UI components needed to build the user interface—that is, when the component type of the required UI component matches the component type information of the UI components contained in the UI component library—the UI component library can be called.
[0073] Module 302 is used to call the UI component library based on the component library name and component library address.
[0074] The interface generation module 303 is used to generate a UI interface based on UI components in the UI component library and the current project.
[0075] Specifically, the UI component library can include script files and component property files for each UI component.
[0076] After calling the UI component library as described above, the script files and component property files corresponding to the UI components in the called UI component library can be read. Based on the component type information included in the script file and the component property information included in the component property file, the UI components in the called UI component library can be rendered to generate the UI interface.
[0077] This application obtains the component library name and address of a UI component library, and then calls a UI component library independent of the development project based on the component library name and address. This allows for the generation of a UI interface based on the UI components in the current development project. This enables flexible calling of the UI component library, thus avoiding the limitation of only calling UI components within the development project. Therefore, each development project can efficiently utilize the UI component library, thereby improving development efficiency.
[0078] This disclosure provides a UI component library calling device, such as... Figure 4 As shown, this is a second structural schematic diagram of a UI component library calling device provided in an embodiment of this disclosure. The device 40 may include: a component type file generation module 401, a component library generation module 402, an acquisition module 403, a calling module 404, and an interface generation module 405.
[0079] The component type file generation module 401 is used to generate component type files based on the script files corresponding to each UI component. The script files include at least the component type information of the corresponding UI component.
[0080] The component library generation module 402 is used to generate a UI component library based on the component type file and the component attribute file corresponding to each UI component, which describes the component attribute information of the UI component.
[0081] The acquisition module 403 is used to obtain the address of the component type file from a preset address list when the component type of the UI component to be called matches the component type information of the corresponding UI component in the UI component library; and to obtain the component library name and component library address based on the address of the component type file.
[0082] Specifically, the component type file includes the component library name.
[0083] The module is specifically used to determine the component library address based on the root path in the path chain contained in the address of the component type file.
[0084] Obtain the component type file based on its address, and then retrieve the component library name.
[0085] The 404 module is used to call the UI component library based on the component library name and the component library address.
[0086] The interface generation module 405 is used to obtain the script file and component property file corresponding to the UI component to be called in the UI component library; based on the component type information included in the script file and the component property information included in the component property file, it renders the UI component to be called in the UI component library to generate the UI interface.
[0087] The UI component library calling device in this embodiment can execute the UI component library calling method shown in the above embodiments of this application. The implementation principle is similar and will not be described again here.
[0088] This application obtains the component library name and address of a UI component library, and then calls a UI component library independent of the development project based on the component library name and address. This allows for the generation of a UI interface based on the UI components in the current development project. This enables flexible calling of the UI component library, thus avoiding the limitation of only calling UI components within the development project. Therefore, each development project can efficiently utilize the UI component library, thereby improving development efficiency.
[0089] The following is for reference. Figure 5 This diagram illustrates a structural schematic of an electronic device 600 suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0090] The electronic device includes a memory and a processor, wherein the processor may be referred to as processing device 601 as described below, and the memory may include at least one of read-only memory (ROM) 602, random access memory (RAM) 603, and storage device 608 as described below, as follows:
[0091] like Figure 5 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0092] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0093] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0094] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0095] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0096] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0097] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: obtain the component library name and component library address of a UI component library, wherein the UI component library runs independently outside the current project; invoke the UI component library according to the component library name and the component library address; and generate a UI interface through the current project based on the UI components in the UI component library.
[0098] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0100] The modules or units described in the embodiments of this disclosure can be implemented in software or hardware. The names of modules or units do not necessarily limit the unit itself; for example, an interface generation module can also be described as "a module that generates a UI interface based on UI components in a UI component library".
[0101] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0102] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0103] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0104] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0105] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for calling a UI component library, characterized in that, include: The component library name and address of the UI component library are obtained. The UI component library runs independently outside the current project. The current project includes the component type information of the UI components corresponding to the UI component library. The component library name and address are obtained based on the address of the component type file. The address of the component type file is obtained from a preset address list when the component type of the UI component to be called matches the component type information of the UI component corresponding to the UI component library. The UI component library is invoked based on the component library name and the component library address; The UI interface is generated based on the UI components in the UI component library and the current project.
2. The UI component library calling method according to claim 1, characterized in that, Before obtaining the component library name and address of the UI component library, the method further includes: Based on the script files corresponding to each UI component, a component type file is generated, wherein the script file includes at least the component type information of the corresponding UI component; The UI component library is generated based on the component type file and the component attribute file corresponding to each UI component, which describes the component attribute information of the UI component.
3. The component library calling method according to claim 1, characterized in that, The component type file includes the component library name. The step of obtaining the component library name and the component library address based on the address of the component type file includes: The component library address is determined based on the root path in the path chain contained in the address of the component type file; Obtain the component type file based on its address to obtain the component library name.
4. The UI component library calling method according to any one of claims 1 to 3, characterized in that, The process of generating a UI interface based on UI components in the UI component library through the current project includes: Obtain the script file and component property file corresponding to the UI component to be called from the UI component library; Based on the component type information included in the script file and the component attribute information included in the component attribute file, render the UI component to be called in the UI component library to generate the UI interface.
5. The UI component library calling method according to claim 4, characterized in that, The component attribute information includes at least one of the following: component shape information, component color information, and component parameter information.
6. A UI component library calling device, characterized in that, include: The acquisition module is used to acquire the component library name and component library address of the UI component library, which runs independently outside the current project; the current project includes the component type information of the UI components corresponding to the UI component library; the component library name and component library address are acquired based on the address of the component type file; the address of the component type file is acquired from a preset address list when the component type of the UI component to be called matches the component type information of the UI component corresponding to the UI component library; The calling module is used to call the UI component library according to the component library name and the component library address; The interface generation module is used to generate a UI interface based on the UI components in the UI component library and the current project.
7. The recall device according to claim 6, characterized in that, Also includes: The component type file generation module is used to generate component type files based on the script files corresponding to each UI component. The script files include at least the component type information of the corresponding UI component. The component library generation module is used to generate the UI component library based on the component type file and the component attribute file corresponding to each UI component, which describes the component attribute information of the UI component.
8. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to: execute the UI component library invocation method according to any one of claims 1 to 5.
9. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the UI component library invocation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
UI generation method and device, electronic device and computer readable storage medium
CN109766097A