[go: up one dir, main page]

CN118192965A - Page component processing method, device, computer equipment, storage medium and product - Google Patents

Page component processing method, device, computer equipment, storage medium and product Download PDF

Info

Publication number
CN118192965A
CN118192965A CN202410379475.XA CN202410379475A CN118192965A CN 118192965 A CN118192965 A CN 118192965A CN 202410379475 A CN202410379475 A CN 202410379475A CN 118192965 A CN118192965 A CN 118192965A
Authority
CN
China
Prior art keywords
component
party
folder
page
code file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410379475.XA
Other languages
Chinese (zh)
Inventor
张民遐
司徒欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Gaodeng Weixing Technology Co ltd
Original Assignee
Anhui Gaodeng Weixing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Gaodeng Weixing Technology Co ltd filed Critical Anhui Gaodeng Weixing Technology Co ltd
Priority to CN202410379475.XA priority Critical patent/CN118192965A/en
Publication of CN118192965A publication Critical patent/CN118192965A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a page component processing method, a page component processing device, computer equipment, a storage medium and a page component processing product. The method comprises the following steps: responding to an installation instruction for installing a third party component library, and storing respective component code files of at least one third party page component in the third party component library into a third party component folder under a program project catalog of an application program; responding to an execution instruction of a logic file which is preconfigured under an execution program project directory, and determining a target folder matched with a third party component folder in a native component folder under the program project directory by executing the logic file; and storing the respective component code files of at least one third-party page component in the third-party component folder into the target folder. By adopting the method, operation and maintenance resources can be saved.

Description

页面组件处理方法、装置、计算机设备、存储介质和产品Page component processing method, device, computer equipment, storage medium and product

技术领域Technical Field

本申请涉及页面技术领域,特别是涉及一种页面组件方法、装置、计算机设备、存储介质和计算机程序产品。The present application relates to the field of page technology, and in particular to a page component method, apparatus, computer equipment, storage medium and computer program product.

背景技术Background technique

随着计算机技术的发展,在应用程序如小程序的页面的设计上,通常采用组件化开发方式,通过开发工具将页面组件引用到页面的代码文件中,运行页面的代码文件可渲染出页面组件以形成页面。在设计页面时,为了提高页面的可扩展性,在使用基础的页面组件之外,通常需引用第三方组件库中的第三页面组件,在现有的开发工具中,通常通过启动开发工具中的第三方支持功能引入第三方页面组件,第三方支持功能例如NPM(NodePackage Manager,Node.js中的包管理器,Node.js是一种开源的跨平台的运行环境和库)模块构建功能。然而,早期版本的开发工具不提供第三方支持功能,需升级应用程序的整体代码以适配能够提供第三方支持功能的开发工具,从而可以使用第三方支持功能以灵活引入第三方组件。With the development of computer technology, in the design of application pages such as mini-programs, component-based development is usually adopted. The page components are referenced to the page code file through the development tool. The page code file can be run to render the page components to form a page. When designing a page, in order to improve the scalability of the page, in addition to using the basic page components, it is usually necessary to reference the third page components in the third-party component library. In existing development tools, third-party page components are usually introduced by starting the third-party support function in the development tool. The third-party support function is such as the NPM (NodePackage Manager, a package manager in Node.js, Node.js is an open source cross-platform operating environment and library) module building function. However, early versions of development tools do not provide third-party support functions, and the overall code of the application needs to be upgraded to adapt to the development tools that can provide third-party support functions, so that the third-party support function can be used to flexibly introduce third-party components.

然而,升级应用程序代码的方式,需消耗大量运维资源。However, upgrading application code consumes a lot of operation and maintenance resources.

发明内容Summary of the invention

基于此,有必要针对上述技术问题,提供一种能够节约运维资源的页面组件处理方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。Based on this, it is necessary to provide a page component processing method, device, computer equipment, computer-readable storage medium and computer program product that can save operation and maintenance resources in response to the above technical problems.

第一方面,本申请提供了一种页面组件处理方法,包括:In a first aspect, the present application provides a page component processing method, comprising:

响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中;In response to an installation instruction for installing a third-party component library, storing a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application;

响应于执行所述程序项目目录下预配置的逻辑文件的执行指令,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹;In response to an execution instruction of a preconfigured logic file under the program project directory, determining a target folder matching the third-party component folder in a native component folder under the program project directory by executing the logic file;

将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中;所述目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在所述应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染所述应用程序的所述页面时,根据所述页面代码文件以及引用的第三方组件的组件代码文件,渲染所述页面。The component code file of at least one third-party page component in the third-party component folder is stored in the target folder; the component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application when the page code file of the page in the application references any third-party page component.

第二方面,本申请还提供了一种页面组件处理装置,包括:In a second aspect, the present application further provides a page component processing device, including:

第三方组件文件夹管理模块,用于响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中;A third-party component folder management module, configured to store a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application program in response to an installation instruction for installing the third-party component library;

目标文件夹管理模块,用于响应于执行所述程序项目目录下预配置的逻辑文件的执行指令 ,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹;将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中;所述目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在所述应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染所述应用程序的所述页面时,根据所述页面代码文件以及引用的第三方组件的组件代码文件,渲染所述页面。A target folder management module is used to respond to an execution instruction of a preconfigured logic file under the program project directory, determine a target folder matching the third-party component folder in a native component folder under the program project directory by executing the logic file; store a component code file of at least one third-party page component in the third-party component folder in the target folder; and a component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application program, when the page code file of the page in the application program references any third-party page component.

第三方面,本申请还提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中;In response to an installation instruction for installing a third-party component library, storing a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application;

响应于执行所述程序项目目录下预配置的逻辑文件的执行指令,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹;In response to an execution instruction of a preconfigured logic file under the program project directory, determining a target folder matching the third-party component folder in a native component folder under the program project directory by executing the logic file;

将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中;所述目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在所述应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染所述应用程序的所述页面时,根据所述页面代码文件以及引用的第三方组件的组件代码文件,渲染所述页面。The component code file of at least one third-party page component in the third-party component folder is stored in the target folder; the component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application when the page code file of the page in the application references any third-party page component.

第四方面,本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中;In response to an installation instruction for installing a third-party component library, storing a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application;

响应于执行所述程序项目目录下预配置的逻辑文件的执行指令,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹;In response to an execution instruction of a preconfigured logic file under the program project directory, determining a target folder matching the third-party component folder in a native component folder under the program project directory by executing the logic file;

将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中;所述目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在所述应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染所述应用程序的所述页面时,根据所述页面代码文件以及引用的第三方组件的组件代码文件,渲染所述页面。The component code file of at least one third-party page component in the third-party component folder is stored in the target folder; the component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application when the page code file of the page in the application references any third-party page component.

第五方面,本申请还提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中;In response to an installation instruction for installing a third-party component library, storing a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application;

响应于执行所述程序项目目录下预配置的逻辑文件的执行指令,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹;In response to an execution instruction of a preconfigured logic file under the program project directory, determining a target folder matching the third-party component folder in a native component folder under the program project directory by executing the logic file;

将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中;所述目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在所述应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染所述应用程序的所述页面时,根据所述页面代码文件以及引用的第三方组件的组件代码文件,渲染所述页面。The component code file of at least one third-party page component in the third-party component folder is stored in the target folder; the component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application when the page code file of the page in the application references any third-party page component.

上述页面组件处理方法、装置、计算机设备、存储介质和产品,响应于安装指令,将至少一个第三方页面组件各自组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中,进而,响应于执行逻辑文件的执行指令,将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至目标文件夹中;由于目标文件夹在程序项目目录下的原生组件文件夹中,原生组件文件夹中的组件适配于程序项目,从而,在进行页面设计时,可在页面的页面代码文件中引用目标文件夹中的第三方页面组件,进而可在后续渲染页面时基于引用的第三方组件的组件代码文件渲染页面,由此,在无需升级应用程序的整体代码文件的情况下,通过执行程序项目目录中的逻辑文件将第三方组件的代码文件存储到目标文件夹下,使得可以在页面代码文件中引用第三方组件,相较于升级应用程序的整体代码文件的方式,减少了运维资源消耗。The above-mentioned page component processing method, device, computer equipment, storage medium and product, in response to the installation instruction, store the respective component code file of at least one third-party page component in the third-party component folder under the program project directory of the application, and then, in response to the execution instruction of the execution logic file, store the respective component code file of at least one third-party page component in the third-party component folder in the target folder; because the target folder is in the native component folder under the program project directory, the components in the native component folder are adapted to the program project, and thus, when designing the page, the third-party page component in the target folder can be referenced in the page code file of the page, and then the page can be rendered based on the component code file of the referenced third-party component when rendering the page subsequently. Therefore, without upgrading the overall code file of the application, the code file of the third-party component is stored in the target folder by executing the logic file in the program project directory, so that the third-party component can be referenced in the page code file, which reduces the consumption of operation and maintenance resources compared to the method of upgrading the overall code file of the application.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

图1为一个实施例中页面组件处理方法的应用环境图;FIG1 is an application environment diagram of a page component processing method in one embodiment;

图2为一个实施例中页面组件处理方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a page component processing method in one embodiment;

图3为一个实施例中第三方页面组件的组件代码文件示例示意图;FIG3 is a schematic diagram of an example component code file of a third-party page component in one embodiment;

图4为一个实施例中第三方页面组件的显示样例示意图;FIG4 is a schematic diagram of a display example of a third-party page component in one embodiment;

图5为一个实施例中页面组件处理步骤简略流程示意图;FIG5 is a simplified flow chart of page component processing steps in one embodiment;

图6为一个实施例中页面组件处理步骤的时序示意图;FIG6 is a schematic diagram of the timing sequence of page component processing steps in one embodiment;

图7为一个实施例中页面组件处理装置的结构框图;FIG7 is a structural block diagram of a page component processing device in one embodiment;

图8为一个实施例中计算机设备的内部结构图。FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

本申请实施例提供的页面组件处理方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与服务器104进行通信。数据存储系统可以存储服务器104需要处理的数据。数据存储系统可以集成在服务器104上,也可以放在云上或其他网络服务器上。终端102可响应于安装第三方组件库的安装指令,从服务器104获取第三方组件库中至少一个第三方组件各自的组件代码文件,将获取的组件代码文件存储至应用程序的程序项目目录下的第三方组件文件夹中,终端102可响应于执行程序目录下预配置的逻辑文件的执行指令,通过执行逻辑文件,在程序项目目录的原生组件文件夹中,确定与第三方组件文件夹匹配的目标文件夹,将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件存储至目标文件夹中。其中,终端102可以是个人计算机、笔记本电脑、智能手机或平板电脑。服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。服务器104上可运行第三方代码平台中的服务端。The page component processing method provided in the embodiment of the present application can be applied in the application environment as shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 can respond to the installation instruction of installing the third-party component library, obtain the component code file of at least one third-party component in the third-party component library from the server 104, and store the obtained component code file in the third-party component folder under the program project directory of the application program. The terminal 102 can respond to the execution instruction of the pre-configured logic file under the execution program directory, and by executing the logic file, in the native component folder of the program project directory, determine the target folder that matches the third-party component folder, and store the component code file of at least one third-party page component in the third-party component folder to the target folder. Among them, the terminal 102 can be a personal computer, a laptop, a smart phone or a tablet computer. The server 104 can be implemented with an independent server or a server cluster composed of multiple servers. The server 104 can run the service end in the third-party code platform.

在一个实施例中,如图2所示,提供了一种页面组件处理方法,以该方法应用于图1中的终端102为例进行说明,包括以下步骤202至步骤206。其中:In one embodiment, as shown in FIG. 2 , a page component processing method is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, and includes the following steps 202 to 206 . Among them:

步骤202,响应于安装第三方组件库的安装指令,将第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中。Step 202, in response to the installation instruction for installing the third-party component library, the component code file of at least one third-party page component in the third-party component library is stored in a third-party component folder under the program project directory of the application.

其中,第三方组件库是包括至少一个第三方页面组件的组件库。第三方是开发应用程序的开发方和使用应用程序的使用方之外的一方。第三方具体可以是指第三方代码平台。应用程序是为完成某项或多项特定工作的计算机程序。应用程序可以是原生应用程序、网页应用程序或者运行在原生应用程序中的子应用程序。原生应用程序是依托于操作系统运行的应用程序,需用户下载应用程序的安装包并安装后使用。网页应用程序是基于Web(World Wide Web,全球广域网)技术构建的软件应用程序,可以通过互联网访问和使用。子应用程序无需用户安装即可使用。例如,子应用程序可以是运行在微信中的微信小程序,也可以是运行在支付宝中的支付宝小程序。Among them, the third-party component library is a component library that includes at least one third-party page component. The third party is a party other than the developer of the application and the user of the application. The third party can specifically refer to a third-party code platform. An application is a computer program for completing one or more specific tasks. An application can be a native application, a web application, or a sub-application running in a native application. A native application is an application that relies on an operating system to run, and the user needs to download the installation package of the application and install it before use. A web application is a software application built based on Web (World Wide Web, Global Wide Area Network) technology that can be accessed and used over the Internet. A sub-application can be used without user installation. For example, a sub-application can be a WeChat applet running in WeChat, or an Alipay applet running in Alipay.

应用程序的开发方可以是进行应用程序开发时使用的开发终端。在开发终端上可运行开发工具,通过开发工具开发应用程序。例如,开发工具可以是微信官方提供可用于开发微信小程序的微信开发者工具、Taro(一个多端同一开发的框架)、WePY(一个类Vue语法的小程序组件化开发框架)、uni-app(一个使用Vue.js开发跨平台应用的框架)或其它。Vue是用于构建用户界面的JavaScript(一种具有函数优先的轻量级,解释型或即时编译型的编程语言)框架。应用程序的使用方可以是客户端。第三方代码平台可以是包管理工具,包管理工具例如NPM、PNPM(Performant NPM,高性能的NPM)、Yarn(由Facebook(脸谱网)发布的JavaScript(一种具有函数优先的轻量级,解释型或即时编译型的编程语言)包管理器)。第三方组件库可以是存储在包管理工具中的一个组件包对应的组件库。组件包是第三方组件库对应的代码包。The developer of the application may be a development terminal used for application development. Development tools can be run on the development terminal to develop applications. For example, the development tool may be a WeChat developer tool provided by WeChat for developing WeChat mini-programs, Taro (a framework for multi-terminal development), WePY (a mini-program component development framework with Vue-like syntax), uni-app (a framework for developing cross-platform applications using Vue.js), or others. Vue is a JavaScript (a lightweight, interpreted or just-in-time compiled programming language with function priority) framework for building user interfaces. The user of the application may be a client. The third-party code platform may be a package management tool, such as NPM, PNPM (Performant NPM), Yarn (JavaScript (a lightweight, interpreted or just-in-time compiled programming language with function priority) package manager released by Facebook). The third-party component library may be a component library corresponding to a component package stored in a package management tool. The component package is a code package corresponding to a third-party component library.

安装指令是用于安装第三方组件库的指令。安装指令具体可以是在命令行工具中,输入由安装命令标识和第三方组件库的标识组成的安装命令后触发的计算机指令。安装命令标识可以是包管理工具中用于安装代码包的命令标识,例如安装命令标识可以是“npm i”。第三方组件库的标识是用于将第三方组件库与其他库相区别的信息,例如第三方组件库的标识可以第三方组件库的名称、第三方组件库在包管理工具中的路径或其它。安装命令用于调用第三方提供的安装组件库的服务。例如,若第三方组件库的标识是“step”,则安装命令可以是“npm i step”,提供NPM服务的Node服务器可接收安装命令,获取“step”对应的组件包并反馈至终端。命令行工具是一种用户与计算机操作系统进行交互的方式,它通过文本界面提供了一种执行命令和程序的途径。命令行工具可以是微信开发者工具中的内建终端。The installation instruction is an instruction for installing a third-party component library. The installation instruction can specifically be a computer instruction triggered after inputting an installation command consisting of an installation command identifier and an identifier of a third-party component library in a command line tool. The installation command identifier can be a command identifier used to install a code package in a package management tool, for example, the installation command identifier can be "npm i". The identifier of a third-party component library is information used to distinguish a third-party component library from other libraries, for example, the identifier of a third-party component library can be the name of the third-party component library, the path of the third-party component library in the package management tool, or other. The installation command is used to call the installation component library service provided by a third party. For example, if the identifier of a third-party component library is "step", the installation command can be "npm i step", and the Node server providing the NPM service can receive the installation command, obtain the component package corresponding to "step" and feedback to the terminal. A command line tool is a way for a user to interact with a computer operating system, which provides a way to execute commands and programs through a text interface. The command line tool can be a built-in terminal in the WeChat developer tool.

应用程序的程序项目目录是在开发工具中针对该应用程序配置的专用文件夹。不同应用程序对应不同的程序项目目录。应用程序的程序项目目录中存放与应用程序相关的资源,如应用程序中各项功能对应的代码文件,又如应用程序中的图片、视频、音频、控件等资源。The application's project directory is a dedicated folder configured for the application in the development tool. Different applications correspond to different project directories. The application's project directory stores resources related to the application, such as code files corresponding to various functions in the application, and resources such as pictures, videos, audio, and controls in the application.

第三方组件文件夹用于存储响应于安装指令后获取的至少一个第三方页面组件各自的组件代码文件。例如,第三方组件文件夹可以是node_modules文件夹。在开发工具不提供第三方支持功能的情况下,第三方组件文件夹中的第三方页面组件无法直接被引用到应用程序的页面代码文件中。在早期版本的开发工具中不提供第三方支持功能,早期版本的开发工具例如1.x版本(例如1.6.0版本、1.7.0版本)的WePY工具、1.02.1808300版本之前的微信开发者工具,而在后期版本的开发工具中,可提供第三方支持功能,例如,在1.02.1808300版本之后的微信开发者工具中,可在菜单栏的“工具”这一选项卡的目录下提供“构建npm”这一功能,通过启用这一功能,可以在页面代码文件中直接引用第三方组件文件夹中的第三方页面组件。而本申请提供的页面组件处理方法,提供了一种在开发工具不提供第三方支持功能的情况下,在页面代码文件中引用第三方页面组件的解决方案。The third-party component folder is used to store the component code files of at least one third-party page component obtained in response to the installation instruction. For example, the third-party component folder can be a node_modules folder. In the case where the development tool does not provide third-party support functions, the third-party page components in the third-party component folder cannot be directly referenced in the page code file of the application. The third-party support function is not provided in the early versions of the development tools, such as the WePY tool of version 1.x (for example, version 1.6.0, version 1.7.0), and the WeChat developer tool before version 1.02.1808300, while in the later versions of the development tools, third-party support functions can be provided. For example, in the WeChat developer tool after version 1.02.1808300, the "Build npm" function can be provided under the directory of the "Tools" tab of the menu bar. By enabling this function, the third-party page components in the third-party component folder can be directly referenced in the page code file. The page component processing method provided in the present application provides a solution for referencing third-party page components in page code files when the development tool does not provide third-party support functions.

至少一个第三方页面组件是第三方组件库所包括的第三方页面组件。至少一个第三方页面组件的数量可以是一个也可以是多个。在子应用程序的开发工具中,如微信开发者工具,可提供基础页面组件,基础页面组件如视图容器、文本、轮播或其它,还可以由开发者在应用程序的程序项目目录的原生组件文件夹中创建的自定义页面组件。第三方页面组件与基础页面组件和自定义页面组件不同,第三方页面组件是通过第三方提供的组件。第三方页面组件具体可以是ETC(Electronic Toll Collection,电子不停车)支持功能页面中的组件。ETC支持功能例如ETC充值功能、ETC激活功能等。At least one third-party page component is a third-party page component included in the third-party component library. The number of at least one third-party page component can be one or more. In the development tools of the sub-application, such as WeChat developer tools, basic page components can be provided. Basic page components such as view containers, text, carousels or others can also be custom page components created by developers in the native component folder of the program project directory of the application. Third-party page components are different from basic page components and custom page components. Third-party page components are components provided by third parties. Third-party page components can specifically be components in the ETC (Electronic Toll Collection, electronic non-stop) support function page. ETC supports functions such as ETC recharge function, ETC activation function, etc.

组件代码文件是用于在页面中渲染出组件的代码文件。例如,在子应用程序中,组件代码文件可包括文件扩展名为“.js”的组件逻辑代码文件、“.wxml”的组件结构代码文件、“.wxss”的组件样式代码文件以及“.json”的组件配置代码文件。第三方页面组件的组件代码文件还对应有显示样例。参见如图3所示的第三方页面组件的组件代码文件示例示意图,当选中程序项目目录下原生组件文件夹(components)下的第三方页面组件(steps)对应的组件结构代码文件(index.wxml),可显示组件结构代码文件对应的代码内容。Component code files are code files used to render components in a page. For example, in a sub-application, component code files may include component logic code files with a file extension of ".js", component structure code files with a file extension of ".wxml", component style code files with a file extension of ".wxss", and component configuration code files with a file extension of ".json". The component code files of third-party page components also have corresponding display samples. Referring to the example diagram of component code files of third-party page components shown in Figure 3, when the component structure code file (index.wxml) corresponding to the third-party page component (steps) under the native component folder (components) under the program project directory is selected, the code content corresponding to the component structure code file can be displayed.

如图4所示的第三方页面组件的显示样例示意图,是根据第三方页面组件(steps)对应的组件代码文件显示的样例。第三方组件库中的第三方页面组件对应的显示样例都可以显示在组件示例主页中,从而通过可视化的方式,将第三方页面组件显示为显示样例,使得开发者可以容易地确定第三方页面组件的功能和样式等,且组件示例主页可显示各第三方页面组件对应的图标,在对第三方页面组件对应的图标点击后,可跳转显示第三方页面组件的组件代码文件,便于开发者使用第三方页面组件进行设计。The display sample diagram of the third-party page component shown in Figure 4 is a sample displayed according to the component code file corresponding to the third-party page component (steps). The display samples corresponding to the third-party page components in the third-party component library can be displayed in the component sample homepage, so that the third-party page components can be displayed as display samples in a visual way, so that developers can easily determine the functions and styles of the third-party page components, and the component sample homepage can display the icons corresponding to each third-party page component. After clicking the icon corresponding to the third-party page component, the component code file of the third-party page component can be jumped to display, which is convenient for developers to use third-party page components for design.

在一个实施例中,终端可在用于开发应用程序的开发工具中,显示与开发工具关联的命令行工具,当检测到命令行工具中输入的安装第三方组件库的安装命令,触发安装第三方组件库的安装指令。In one embodiment, the terminal may display a command line tool associated with the development tool in the development tool for developing the application, and trigger an installation instruction for installing the third-party component library when an installation command for installing the third-party component library is detected in the command line tool.

在一个实施例中,终端可响应于安装第三方组件库的安装指令,从第三方代码平台获取的第三方组件库对应的组件包,将第三方组件库对应的组件包解压缩后,获得第三方组件库中至少一个第三方页面组件各自的组件代码文件,将获得的第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中。In one embodiment, the terminal can respond to the installation instruction of installing a third-party component library, obtain the component package corresponding to the third-party component library from the third-party code platform, decompress the component package corresponding to the third-party component library, obtain the component code file of at least one third-party page component in the third-party component library, and store the obtained component code file of at least one third-party page component in the third-party component library in the third-party component folder under the program project directory of the application.

步骤204,响应于执行程序项目目录下预配置的逻辑文件的执行指令,通过执行逻辑文件,在程序项目目录下的原生组件文件夹中,确定与第三方组件文件夹匹配的目标文件夹。Step 204, in response to the execution instruction of the preconfigured logic file in the program project directory, a target folder matching the third-party component folder is determined in the native component folder in the program project directory by executing the logic file.

其中,预配置的逻辑文件是预先配置在程序项目目录下,通过逻辑代码对第三方页面组件进行管理的文件。具体地,可通过执行逻辑文件,实现步骤204至步骤206。逻辑文件可以是采用JavaScript 语言编写的JS脚本文件。执行指令是用于触发执行逻辑文件的计算机指令。The pre-configured logic file is a file pre-configured in the program project directory to manage the third-party page components through logic code. Specifically, steps 204 to 206 can be implemented by executing the logic file. The logic file can be a JS script file written in JavaScript. The execution instruction is a computer instruction for triggering the execution of the logic file.

原生组件文件夹设置在程序项目目录下,用于存储组件的组件代码文件。原生组件文件夹中的组件可直接在应用程序的页面的页面代码文件中被引用。原生组件文件夹也可以称为Component文件夹。目标文件夹是原生组件文件夹下的子文件夹,可用于存储从第三方组件文件夹中获取的第三方页面组件的组件代码文件。目标文件夹的文件夹标识可与第三方组件文件夹的文件夹标识相匹配。The native component folder is set in the program project directory and is used to store the component code files of the components. The components in the native component folder can be directly referenced in the page code files of the application's pages. The native component folder can also be called the Component folder. The target folder is a subfolder under the native component folder and can be used to store the component code files of third-party page components obtained from the third-party component folder. The folder identifier of the target folder can match the folder identifier of the third-party component folder.

在一个实施例中,在程序项目目录下存在项目配置文件的情况下,当接收到在项目配置文件中输入的针对逻辑文件配置的预设执行命令,终端可触发执行逻辑文件的执行指令。In one embodiment, when there is a project configuration file in the program project directory, upon receiving a preset execution command for the logic file configuration input in the project configuration file, the terminal may trigger an execution instruction for executing the logic file.

其中,项目配置文件是用于描述应用程序的程序项目的配置文件。项目配置文件中可包括程序项目的相关信息和依赖项,可以通过NPM工具进行管理和生成。程序项目的相关信息如项目名称、版本号、作者等信息。在子应用程序中,项目配置文件可以称为package.json文件,该文件是JSON(JavaScript Object Notation,JS对象简谱)格式的文件。预设执行命令是预先设置的用于触发执行指令的命令。例如,预设执行命令例如可以是node setting.js。Among them, the project configuration file is a configuration file used to describe the program project of the application. The project configuration file may include relevant information and dependencies of the program project, which can be managed and generated through the NPM tool. Relevant information of the program project includes project name, version number, author and other information. In the sub-application, the project configuration file can be called a package.json file, which is a file in JSON (JavaScript Object Notation, JS object notation) format. The preset execution command is a pre-set command for triggering the execution instruction. For example, the preset execution command can be, for example, node setting.js.

在一个实施例中,终端可响应于执行程序项目目录下预配置的逻辑文件的执行指令,解析逻辑文件后执行,通过执行逻辑文件,从程序项目目录下的原生组件文件夹中查询与第三方组件文件夹匹配的文件夹,获得查询结果,根据查询结果确定与第三方组件文件夹匹配的目标文件夹。In one embodiment, the terminal may respond to an execution instruction of a preconfigured logic file under the execution program project directory, parse the logic file and then execute it, and by executing the logic file, query the folder that matches the third-party component folder from the native component folder under the program project directory to obtain the query result, and determine the target folder that matches the third-party component folder based on the query result.

步骤206,将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至目标文件夹中;目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染应用程序的页面时,根据页面代码文件以及引用的第三方组件的组件代码文件,渲染页面。Step 206, storing the component code file of at least one third-party page component in the third-party component folder into the target folder; the component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application when the page code file of the page in the application references any third-party page component.

其中,页面代码文件用于渲染应用程序的页面。在子应用程序中,每个页面可对应一个页面代码文件。页面代码文件可包括页面逻辑代码文件、页面结构代码文件、页面样式代码文件和页面配置代码文件。页面逻辑代码文件用于控制页面的处理逻辑,该文件的文件扩展名可以是“.js”。页面结构代码文件用于设计页面的布局、进行数据绑定等,该文件的文件扩展名可以是“.wxml”。页面样式代码文件用于定义页面中用到的各类样式表,该文件的文件扩展名可以是“.wxss”。页面配置代码文件用于进行页面配置,该文件的文件扩展名可以是“.json”。Among them, the page code file is used to render the page of the application. In the sub-application, each page may correspond to a page code file. The page code file may include a page logic code file, a page structure code file, a page style code file, and a page configuration code file. The page logic code file is used to control the processing logic of the page, and the file extension of this file may be ".js". The page structure code file is used to design the layout of the page, perform data binding, etc., and the file extension of this file may be ".wxml". The page style code file is used to define various style sheets used in the page, and the file extension of this file may be ".wxss". The page configuration code file is used to configure the page, and the file extension of this file may be ".json".

在一个实施例中,在目标文件夹中不存在历史存储的历史第三方组件的组件代码文件的情况下,终端可将第三方组件文件夹中存储的第三方组件库的至少一个第三方页面组件各自的组件代码文件,存储至目标文件夹。In one embodiment, when there is no component code file of a historically stored third-party component in the target folder, the terminal may store the component code file of at least one third-party page component of the third-party component library stored in the third-party component folder into the target folder.

在一个实施例中,在目标文件夹中存在历史存储的历史第三方组件的组件代码文件的情况下,终端可将目标文件夹中存在的历史存储的组件代码文件删除,再将第三方组件文件夹中存储的第三方组件库的至少一个第三方页面组件各自的组件代码文件,存储至目标文件夹。In one embodiment, when there are component code files of historically stored third-party components in the target folder, the terminal may delete the component code files historically stored in the target folder, and then store the component code files of at least one third-party page component of the third-party component library stored in the third-party component folder in the target folder.

上述页面组件处理方法中,响应于安装指令,将至少一个第三方页面组件各自组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中,进而,响应于执行逻辑文件的执行指令,将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至目标文件夹中;由于目标文件夹在程序项目目录下的原生组件文件夹中,原生组件文件夹中的组件适配于程序项目,从而,在进行页面设计时,可在页面的页面代码文件中引用目标文件夹中的第三方页面组件,进而可在后续渲染页面时基于引用的第三方组件的组件代码文件渲染页面,由此,在无需升级应用程序的整体代码文件的情况下,通过执行程序项目目录中的逻辑文件将第三方组件的代码文件存储到目标文件夹下,使得可以在页面代码文件中引用第三方组件,相较于升级应用程序的整体代码文件的方式,减少了运维资源消耗。In the above-mentioned page component processing method, in response to the installation instruction, the respective component code file of at least one third-party page component is stored in the third-party component folder under the program project directory of the application, and then, in response to the execution instruction of the execution logic file, the respective component code file of at least one third-party page component in the third-party component folder is stored in the target folder; since the target folder is in the native component folder under the program project directory, the components in the native component folder are adapted to the program project, and thus, when designing the page, the third-party page component in the target folder can be referenced in the page code file of the page, and then the page can be rendered based on the component code file of the referenced third-party component when rendering the page subsequently. Therefore, without upgrading the overall code file of the application, the code file of the third-party component is stored in the target folder by executing the logic file in the program project directory, so that the third-party component can be referenced in the page code file, which reduces the consumption of operation and maintenance resources compared to the method of upgrading the overall code file of the application.

在一个实施例中,步骤202包括:响应于执行程序项目目录下预配置的逻辑文件的执行指令,通过执行逻辑文件,获取程序项目目录下的原生组件文件夹的路径,并获取第三方组件文件夹的文件夹标识;基于原生组件文件夹的路径,在原生组件文件夹中,查询与第三方组件文件夹的文件夹标识匹配的文件夹,获得查询结果;当查询结果表征原生组件文件夹中不存在与第三方组件文件夹的文件夹标识匹配的文件夹,在原生组件文件夹中,创建文件夹标识与第三方组件文件夹的文件夹标识匹配的目标文件夹。In one embodiment, step 202 includes: in response to an execution instruction of a preconfigured logic file under the execution program project directory, by executing the logic file, obtaining the path of the native component folder under the program project directory, and obtaining the folder identifier of the third-party component folder; based on the path of the native component folder, querying the native component folder for a folder that matches the folder identifier of the third-party component folder to obtain a query result; when the query result indicates that there is no folder in the native component folder that matches the folder identifier of the third-party component folder, creating a target folder in the native component folder whose folder identifier matches the folder identifier of the third-party component folder.

其中,原生组件文件夹的路径用于访问原生组件文件夹。原生组件文件夹的路径可以是基于原生组件文件夹的文件夹标识的文件路径。文件夹标识如文件夹名称、文件夹编码等。文件夹标识匹配具体可以是指文件夹标识相同。The path of the native component folder is used to access the native component folder. The path of the native component folder may be a file path based on a folder identifier of the native component folder. The folder identifier may be a folder name, a folder code, etc. Folder identifier matching may specifically refer to the same folder identifier.

本实施例中,通过原生组件文件夹的路径可访问原生组件文件夹,从而可查询是否存在与第三方组件文件夹的文件夹标识匹配的文件夹,在不存在时,创建目标文件夹,从而可在原生组件文件夹中专门对应与第三方组件文件夹设置目标文件夹,为后续将第三方页面组件的组件代码文件存储至目标文件夹中创造条件。In this embodiment, the native component folder can be accessed through the path of the native component folder, so that it can be queried whether there is a folder matching the folder identifier of the third-party component folder. If it does not exist, a target folder is created, so that a target folder can be set in the native component folder specifically corresponding to the third-party component folder, creating conditions for subsequently storing the component code files of the third-party page component in the target folder.

在一个实施例中,终端可按照原生组件文件夹的路径,访问原生组件文件夹,获取原生组件文件夹下子文件夹的文件夹标识,在子文件夹的文件夹标识中,查询与第三方组件文件夹的文件夹标识匹配的文件夹,获得查询结果。In one embodiment, the terminal can access the native component folder according to the path of the native component folder, obtain the folder identifier of the subfolder under the native component folder, and query the folder identifier of the subfolder for a folder that matches the folder identifier of the third-party component folder to obtain the query result.

在一个实施例中,上述页面组件处理方法还包括:当查询结果表征原生组件文件夹中存在与第三方组件文件夹的文件夹标识匹配的文件夹,将与第三方组件文件夹的文件夹标识匹配的文件夹确定为目标文件夹;步骤206包括:当目标文件夹中存在组件文件代码,将目标文件夹中存在的组件文件代码从目标文件夹删除;将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,复制到目标文件夹中。In one embodiment, the above-mentioned page component processing method also includes: when the query result indicates that there is a folder in the native component folder that matches the folder identifier of the third-party component folder, the folder that matches the folder identifier of the third-party component folder is determined as the target folder; step 206 includes: when there is component file code in the target folder, the component file code in the target folder is deleted from the target folder; and the component code file of each third-party page component in the third-party component folder is copied to the target folder.

本实施例中,当查询结果表征原生组件文件夹中存在与第三方组件文件夹的文件夹标识匹配的文件夹,说明原生组件文件夹中已创建过目标文件夹,此时将与第三方组件文件夹的文件夹标识匹配的文件夹确定为目标文件夹,无需重复创建;而将目标文件夹中存在的组件文件代码从目标文件夹删除后,再将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件复制到目标文件夹中,可避免目标文件夹中存在重复的第三方页面组件的组件代码文件,可保持目标文件夹简洁,而且可快速地实现目标文件夹中组件代码文件的更新,提高组件代码文件的处理效率。In this embodiment, when the query result indicates that there is a folder in the native component folder that matches the folder identifier of the third-party component folder, it means that the target folder has been created in the native component folder. At this time, the folder that matches the folder identifier of the third-party component folder is determined as the target folder without the need to create it repeatedly. After deleting the component file code existing in the target folder from the target folder, the component code file of at least one third-party page component in the third-party component folder is copied to the target folder. This can avoid the existence of duplicate component code files of third-party page components in the target folder, keep the target folder concise, and quickly update the component code files in the target folder, thereby improving the processing efficiency of component code files.

在一个实施例中,当目标文件夹中存在历史存储的历史第三方组件的组件代码文件,终端可确定第三方组件文件夹中至少一个第三方页面组件中、与历史第三方组件匹配的目标第三方页面组件;当目标第三方页面组件的组件代码文件的第一文件大小、与目标第三方页面组件所匹配的历史第三方组件的组件代码文件的第二文件大小不同时,将目标文件夹中该历史第三方组件的组件代码文件删除后,将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,复制到目标文件夹中。其中,目标第三方页面组件的组件代码文件的文件标识,可与相匹配的历史第三方组件的组件代码文件的文件标识相同。文件标识例如文件名称、文件编码。In one embodiment, when there is a component code file of a historical third-party component stored historically in the target folder, the terminal can determine the target third-party page component that matches the historical third-party component in at least one third-party page component in the third-party component folder; when the first file size of the component code file of the target third-party page component and the second file size of the component code file of the historical third-party component that matches the target third-party page component are different, after deleting the component code file of the historical third-party component in the target folder, copy the component code file of at least one third-party page component in the third-party component folder to the target folder. Among them, the file identifier of the component code file of the target third-party page component can be the same as the file identifier of the component code file of the matched historical third-party component. File identifiers include file names and file codes.

在一个实施例中,当第一文件大小与第二文件大小相同时,终端可在目标文件夹中保留该历史第三方组件的组件代码文件,并将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,复制到目标文件夹中。In one embodiment, when the first file size is the same as the second file size, the terminal may retain the component code file of the historical third-party component in the target folder, and copy the component code file of at least one third-party page component in the third-party component folder to the target folder.

在一个实施例中,步骤202包括:响应于安装第三方组件库的安装指令,确定程序项目目录下第三方文件夹中第三方组件库的组件包的第一版本标识;当通过第三方代码平台确定第一版本标识与第三方组件库最近一次更新的组件包的第二版本标识不匹配,从第三方代码平台中,获取第三方组件库在第二版本标识下的组件包,将获取的组件包存储至第三方文件夹中;将第三方文件夹中第三方组件库在第二版本标识下的组件包进行解压缩,将解压缩获得的第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中。In one embodiment, step 202 includes: in response to an installation instruction to install a third-party component library, determining a first version identifier of a component package of a third-party component library in a third-party folder under a program project directory; when it is determined through a third-party code platform that the first version identifier does not match a second version identifier of a component package of a third-party component library that was most recently updated, obtaining the component package of the third-party component library under the second version identifier from the third-party code platform, and storing the obtained component package in a third-party folder; decompressing the component package of the third-party component library under the second version identifier in the third-party folder, and storing the component code files of at least one third-party page component in the decompressed third-party component library in the third-party component folder under the program project directory of the application.

其中,组件包是将第三方组件库中至少一个第三方页面组件各自的组件代码文件压缩后,形成的代码包。第一版本标识是第三方文件夹中第三方组件库的组件包的版本标识。版本标识用于标识第三方组件库的不同版本的组件包。不同的版本标识可表示对应的组件包的更新时间先后顺序。版本标识可以是版本号,例如V1、V2、V3,又如第一版、第二版、第三版,以此类推;版本标识也可以以修改时间来表示,例如20240301版。第二版本标识是最近一次更新的组件包的版本标识。第一版本标识与第二版本标识不匹配,可以是第一版本标识与第二版本标识不相同。第三方文件夹用于存储第三方组件库的组件包。第三方文件夹具体可以是程序项目目录下的.npm目录。第三方组件库的不同版本标识的组件包,可以具有相同的组件包名称,使得可以在第三方代码平台中确定出第三方组件库的组件包。Among them, the component package is a code package formed by compressing the component code files of at least one third-party page component in the third-party component library. The first version identifier is the version identifier of the component package of the third-party component library in the third-party folder. The version identifier is used to identify the component packages of different versions of the third-party component library. Different version identifiers can indicate the update time sequence of the corresponding component packages. The version identifier can be a version number, such as V1, V2, V3, and the first version, the second version, the third version, and so on; the version identifier can also be expressed by the modification time, such as version 20240301. The second version identifier is the version identifier of the component package that was most recently updated. The first version identifier and the second version identifier do not match, which may be that the first version identifier and the second version identifier are different. The third-party folder is used to store the component packages of the third-party component library. The third-party folder can specifically be a .npm directory under the program project directory. Component packages of different version identifiers of the third-party component library can have the same component package name, so that the component package of the third-party component library can be determined in the third-party code platform.

本实施例中,当第三方文件夹中第三方组件库的组件包的第一版本标识,与第三方代码平台中最近一次更新的组件包的第二版本标识不匹配,可确定当前第三方文件夹中第三方组件库的组件包不是最新的组件包,此时,获取第二版本标识的组件包,可及时更新程序项目目录下的第三方组件库。In this embodiment, when the first version identifier of the component package of the third-party component library in the third-party folder does not match the second version identifier of the component package most recently updated in the third-party code platform, it can be determined that the component package of the third-party component library in the current third-party folder is not the latest component package. At this time, the component package with the second version identifier is obtained, and the third-party component library under the program project directory can be updated in time.

在一个实施例中,终端可通过第三方代码平台的客户端,向第三方代码平台的服务端发起组件包获取请求,第三方代码平台的服务端可响应于组件包获取请求,从组件包获取请求中解析出程序项目目录下第三方文件夹中第三方组件库的组件包的第一版本标识,并在服务端中获取第三方组件库最近一次更新的组件包的第二版本标识,当第一版本标识与第二版本标识不匹配,将第三方组件库在第二版本标识下的组件包发送至终端。其中,第三方代码平台的客户端可以是终端上安装的Node.js中的NPM,第三方代码平台的服务端可以是Node服务器。In one embodiment, the terminal can initiate a component package acquisition request to the server of the third-party code platform through the client of the third-party code platform. The server of the third-party code platform can respond to the component package acquisition request, parse the first version identifier of the component package of the third-party component library in the third-party folder under the program project directory from the component package acquisition request, and obtain the second version identifier of the component package of the third-party component library that was most recently updated in the server. When the first version identifier does not match the second version identifier, the component package of the third-party component library under the second version identifier is sent to the terminal. The client of the third-party code platform can be NPM in Node.js installed on the terminal, and the server of the third-party code platform can be a Node server.

在一个实施例中,上述页面组件处理方法还包括下述步骤:响应于渲染页面的页面渲染触发事件,获取页面的页面代码文件;当通过页面代码文件中的页面配置代码文件,对目标文件夹下至少一个第三方页面组件中的任一第三方页面组件注册有组件标签,且通过页面代码文件中的页面结构代码文件引用有组件标签,则确定页面代码文件引用有组件标签对应的第三方页面组件;根据页面代码文件,以及组件标签对应的第三方页面组件在目标文件夹下的组件代码文件,渲染页面。In one embodiment, the above-mentioned page component processing method also includes the following steps: in response to a page rendering trigger event of rendering a page, obtaining a page code file of the page; when a component tag is registered for any third-party page component of at least one third-party page component under the target folder through the page configuration code file in the page code file, and the component tag is referenced through the page structure code file in the page code file, it is determined that the page code file references the third-party page component corresponding to the component tag; render the page according to the page code file and the component code file of the third-party page component corresponding to the component tag under the target folder.

其中,页面渲染触发事件是触发以渲染页面的事件。页面渲染触发事件可以是自动触发事件,例如,当停留在应用程序的预设页面超过预设时长时自动触发,预设页面例如可以是显示登录成功的页面,预设时长可以是3秒。页面渲染触发事件也可以是手动触发操作,例如,在原生应用程序中点击子应用程序的图标时,触发渲染子应用程序的首页。The page rendering trigger event is an event that triggers the rendering of a page. The page rendering trigger event can be an automatic trigger event, for example, it is automatically triggered when staying on a preset page of the application for more than a preset time. The preset page can be, for example, a page showing a successful login, and the preset time can be 3 seconds. The page rendering trigger event can also be a manual trigger operation, for example, when clicking the icon of a sub-application in the native application, it triggers the rendering of the sub-application's homepage.

页面配置代码文件用于进行页面配置,该文件的文件扩展名可以是“.json”。页面结构代码文件用于设计页面的布局、进行数据绑定等,该文件的文件扩展名可以是“.wxml”。组件标签用于在页面配置代码文件中定义第三方页面组件。The page configuration code file is used for page configuration, and the file extension of this file can be ".json". The page structure code file is used to design the page layout, perform data binding, etc., and the file extension of this file can be ".wxml". The component tag is used to define third-party page components in the page configuration code file.

本实施例中,第三页面组件的组件代码文件存储在原生组件文件夹的目标文件夹下,通过对第三方页面组件注册组件标签并且引用组件标签,从而在渲染页面时可以渲染出第三方页面组件,提高页面显示的多样性。In this embodiment, the component code file of the third page component is stored in the target folder of the native component folder. By registering the component tag for the third-party page component and referencing the component tag, the third-party page component can be rendered when rendering the page, thereby improving the diversity of page display.

在一个实施例中,当在页面代码文件中的页面配置代码文件中,识别到组件注册函数标识,并识别到在对应于组件注册函数标识的函数体中,包括任一第三方页面组件的组件代码文件在原生组件文件夹下的目标文件路径,以及针对目标文件路径的组件标签,终端可确定对目标文件路径对应的第三方页面组件注册有组件标签。其中,目标文件路径可以是用于访问原生组件文件夹下目标文件夹中第三方页面组件对应的组件代码文件的路径。组件注册函数标识可以是组件注册函数名,例如可以是usingComponents。函数体是定义函数功能的代码组成。In one embodiment, when a component registration function identifier is identified in a page configuration code file in a page code file, and it is identified that in the function body corresponding to the component registration function identifier, the target file path of the component code file of any third-party page component in the native component folder, and the component tag for the target file path, the terminal can determine that the third-party page component corresponding to the target file path is registered with a component tag. Among them, the target file path can be a path for accessing the component code file corresponding to the third-party page component in the target folder under the native component folder. The component registration function identifier can be a component registration function name, for example, it can be usingComponents. The function body is composed of codes that define the function function.

在一个实施例中,当在页面代码文件中的页面结构代码文件中,识别到针对组件标签的引用起始标识和引用结束标识,终端可确定通过页面代码文件中的页面结构代码文件引用有组件标签。其中,引用起始标识可以是由引用标识符和组件标签组成。引用结束标识可以是由引用标识符、预设标识符和组件标签组成。具体地,引用标识符可以是“< >”,组件标签可以是“e-step”,预设标识符可以是“/”,则引用起始标识可以是“<e-step>”,引用结束标识可以是“</e-step>”。In one embodiment, when a reference start identifier and a reference end identifier for a component tag are identified in a page structure code file in a page code file, the terminal can determine that a component tag is referenced by the page structure code file in the page code file. Among them, the reference start identifier can be composed of a reference identifier and a component tag. The reference end identifier can be composed of a reference identifier, a preset identifier and a component tag. Specifically, the reference identifier can be "< >", the component tag can be "e-step", the preset identifier can be "/", then the reference start identifier can be "<e-step>", and the reference end identifier can be "</e-step>".

在一个实施例中,上述根据页面代码文件,以及组件标签对应的第三方页面组件在目标文件夹下的组件代码文件,渲染页面的步骤包括:从页面代码文件的页面结构代码文件中,获取对组件标签对应的第三方页面组件的组件属性所赋的目标属性值;根据目标属性值,以及组件标签对应的第三方页面组件在目标文件夹下的组件代码文件,渲染页面。In one embodiment, the step of rendering the page according to the page code file and the component code file of the third-party page component corresponding to the component tag in the target folder includes: obtaining the target attribute value assigned to the component attribute of the third-party page component corresponding to the component tag from the page structure code file of the page code file; rendering the page according to the target attribute value and the component code file of the third-party page component corresponding to the component tag in the target folder.

其中,组件属性用于修饰组件。组件属性具体可用于描述组件在页面中显示的动作、内容、样式等。例如,对于第三方页面组件steps(步骤条),属性可以是color(颜色),在组件代码文件中,可将color的属性值设定为默认值。目标属性值是页面结构代码文件中对第三方页面组件的组件属性所取的值。例如,在页面结构代码文件中,可将第三方页面组件steps中color的目标属性值设置为#93DB70,则在基于第三方页面组件在目标文件夹下的组件代码文件渲染页面时,将目标属性值替换组件代码文件中的color的默认值。Among them, component attributes are used to modify components. Component attributes can be used to describe the actions, content, style, etc. displayed by the component on the page. For example, for the third-party page component steps, the attribute can be color. In the component code file, the attribute value of color can be set to the default value. The target attribute value is the value taken by the component attribute of the third-party page component in the page structure code file. For example, in the page structure code file, the target attribute value of color in the third-party page component steps can be set to #93DB70. When the page is rendered based on the component code file of the third-party page component in the target folder, the target attribute value replaces the default value of color in the component code file.

本实施例中,在页面代码文件中引用有第三方页面组件的情况下,通过页面结构代码文件可设置对第三方页面组件中组件属性的属性值,从而在具体的页面中再对第三方页面组件进行个性化设计,从而使得渲染的页面可以符合个性化需求。In this embodiment, when a third-party page component is referenced in a page code file, the attribute values of the component attributes in the third-party page component can be set through the page structure code file, so that the third-party page component can be personalized in the specific page, so that the rendered page can meet personalized needs.

在一个实施例中,参见如图5所示的页面组件处理步骤简略流程示意图,以及如图6所示的页面组件处理步骤的时序示意图,上述页面组件处理方法具体包括下述步骤。In one embodiment, referring to the simplified flowchart of the page component processing steps as shown in FIG5 , and the timing diagram of the page component processing steps as shown in FIG6 , the above-mentioned page component processing method specifically includes the following steps.

第三方代码平台可接收第三方组件库对应的组件包并存储。其中,该组件包可包括第三方组件库中至少一个第三方页面组件对应的组件代码文件、第三方组件库对应的组件库配置文件。组件库配置文件中可定义第三方组件库中至少一个第三方页面组件各自的组件名称、类型、属性等信息。The third-party code platform can receive and store the component package corresponding to the third-party component library. The component package may include a component code file corresponding to at least one third-party page component in the third-party component library and a component library configuration file corresponding to the third-party component library. The component library configuration file may define the component name, type, attributes and other information of at least one third-party page component in the third-party component library.

第一终端可响应于安装第三方组件库的安装指令,确定程序项目目录下第三方文件夹中第三方组件库的组件包的第一版本标识;当通过第三方代码平台确定第一版本标识与第三方组件库最近一次更新的组件包的第二版本标识不匹配,从第三方代码平台中,获取第三方组件库在第二版本标识下的组件包,将获取的组件包存储至第三方文件夹中;将第三方文件夹中第三方组件库在第二版本标识下的组件包进行解压缩,将解压缩获得的第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中。其中,第一终端可以是开发者使用的终端。通过上述步骤可解析第三方组件库的配置并存储到程序项目目录的第三方组件文件夹中。The first terminal can respond to the installation instruction of installing the third-party component library, determine the first version identification of the component package of the third-party component library in the third-party folder under the program project directory; when it is determined through the third-party code platform that the first version identification does not match the second version identification of the component package of the third-party component library that was most recently updated, obtain the component package of the third-party component library under the second version identification from the third-party code platform, and store the obtained component package in the third-party folder; decompress the component package of the third-party component library under the second version identification in the third-party folder, and store the component code file of at least one third-party page component in the decompressed third-party component library in the third-party component folder under the program project directory of the application. Among them, the first terminal can be a terminal used by the developer. The configuration of the third-party component library can be parsed through the above steps and stored in the third-party component folder of the program project directory.

第一终端可响应于执行程序项目目录下预配置的逻辑文件的执行指令,通过执行逻辑文件,获取程序项目目录下的原生组件文件夹的路径,并获取第三方组件文件夹的文件夹标识;基于原生组件文件夹的路径,在原生组件文件夹中,查询与第三方组件文件夹的文件夹标识匹配的文件夹,获得查询结果。The first terminal can respond to the execution instruction of the pre-configured logic file in the execution program project directory, and obtain the path of the native component folder under the program project directory and the folder identifier of the third-party component folder by executing the logic file; based on the path of the native component folder, query the folder in the native component folder that matches the folder identifier of the third-party component folder to obtain the query result.

当查询结果表征原生组件文件夹中存在与第三方组件文件夹的文件夹标识匹配的文件夹,第一终端可将与第三方组件文件夹的文件夹标识匹配的文件夹确定为目标文件夹;当目标文件夹中存在组件文件代码,将目标文件夹中存在的组件文件代码从目标文件夹删除;将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,复制到目标文件夹中。When the query result indicates that there is a folder in the native component folder that matches the folder identifier of the third-party component folder, the first terminal may determine the folder that matches the folder identifier of the third-party component folder as the target folder; when there is component file code in the target folder, delete the component file code in the target folder from the target folder; and copy the component code file of at least one third-party page component in the third-party component folder to the target folder.

当通过第一终端对应用程序的页面代码文件设计完成,可将设计完成的页面代码文件应用到第二终端上。具体地,第二终端可响应于渲染页面的页面渲染触发事件,获取页面的页面代码文件;当通过页面代码文件中的页面配置代码文件,对目标文件夹下至少一个第三方页面组件中的任一第三方页面组件注册有组件标签,且通过页面代码文件中的页面结构代码文件引用有组件标签,则从页面代码文件的页面结构代码文件中,获取对组件标签对应的第三方页面组件的组件属性所赋的目标属性值;根据目标属性值,以及组件标签对应的第三方页面组件在目标文件夹下的组件代码文件,渲染页面。When the page code file design of the application is completed through the first terminal, the designed page code file can be applied to the second terminal. Specifically, the second terminal can obtain the page code file of the page in response to the page rendering trigger event of the rendered page; when a component tag is registered for any third-party page component in at least one third-party page component under the target folder through the page configuration code file in the page code file, and the component tag is referenced through the page structure code file in the page code file, the target attribute value assigned to the component attribute of the third-party page component corresponding to the component tag is obtained from the page structure code file of the page code file; the page is rendered according to the target attribute value and the component code file of the third-party page component corresponding to the component tag under the target folder.

其中,在设计页面时,通过页面代码文件引用第三方页面组件可实现组件调用。在设计页面过程中,还可以对第三方代码平台中的第三方组件库进行二次开发,更新第三方组件库,从而可以在重新安装第三方组件库时可以调用新的第三方页面组件。第二终端可以是用户使用的终端。应用程序还可以配置有热更新机制,当应用程序的页面代码文件发生更新,可以即时在用户终端的界面上发生更新。应用程序的前端框架可采用React.js(一个声明式、高效且灵活的用于构建用户界面的JavaScript库)、Vue.js或Angular(由MiskoHevery等人创建的一款构建用户界面的前端框架)等框架。在设计页面时,可采用响应式设计的方法,并采用流式布局、弹性网格等技术,使得组件在不同屏幕尺寸、不同分辨率的设备上能够自适应显示。Among them, when designing a page, the component call can be realized by referencing the third-party page component through the page code file. In the process of designing the page, the third-party component library in the third-party code platform can also be secondary developed and updated, so that the new third-party page component can be called when the third-party component library is reinstalled. The second terminal can be a terminal used by the user. The application can also be configured with a hot update mechanism, and when the page code file of the application is updated, it can be updated immediately on the interface of the user terminal. The front-end framework of the application can adopt frameworks such as React.js (a declarative, efficient and flexible JavaScript library for building user interfaces), Vue.js or Angular (a front-end framework for building user interfaces created by Misko Hevery and others). When designing a page, a responsive design method can be adopted, and technologies such as flow layout and elastic grid can be adopted to enable components to be adaptively displayed on devices with different screen sizes and resolutions.

应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的页面组件处理方法的页面组件处理装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个页面组件处理装置实施例中的具体限定可以参见上文中对于页面组件处理方法的限定,在此不再赘述。Based on the same inventive concept, the embodiment of the present application also provides a page component processing device for implementing the page component processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more page component processing device embodiments provided below can refer to the limitations of the page component processing method above, and will not be repeated here.

在一个实施例中,如图7所示,提供了一种页面组件处理装置700,包括:第三方组件文件夹管理模块710和目标文件夹管理模块720,其中:In one embodiment, as shown in FIG. 7 , a page component processing device 700 is provided, including: a third-party component folder management module 710 and a target folder management module 720, wherein:

第三方组件文件夹管理模块710,用于响应于安装第三方组件库的安装指令,将第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中。The third-party component folder management module 710 is used to store the component code file of at least one third-party page component in the third-party component library into the third-party component folder under the program project directory of the application program in response to the installation instruction of the third-party component library.

目标文件夹管理模块720,用于响应于执行程序项目目录下预配置的逻辑文件的执行指令 ,通过执行逻辑文件,在程序项目目录下的原生组件文件夹中,确定与第三方组件文件夹匹配的目标文件夹;将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至目标文件夹中;目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染应用程序的页面时,根据页面代码文件以及引用的第三方组件的组件代码文件,渲染页面。The target folder management module 720 is used to respond to the execution instruction of the pre-configured logic file in the execution program project directory, and determine the target folder matching the third-party component folder in the native component folder under the program project directory by executing the logic file; store the component code file of at least one third-party page component in the third-party component folder in the target folder; the component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application program when the page code file of the page in the application program references any third-party page component.

在一个实施例中,目标文件夹管理模块720还用于响应于执行程序项目目录下预配置的逻辑文件的执行指令,通过执行逻辑文件,获取程序项目目录下的原生组件文件夹的路径,并获取第三方组件文件夹的文件夹标识;基于原生组件文件夹的路径,在原生组件文件夹中,查询与第三方组件文件夹的文件夹标识匹配的文件夹,获得查询结果;当查询结果表征原生组件文件夹中不存在与第三方组件文件夹的文件夹标识匹配的文件夹,在原生组件文件夹中,创建文件夹标识与第三方组件文件夹的文件夹标识匹配的目标文件夹。In one embodiment, the target folder management module 720 is also used to respond to the execution instruction of the pre-configured logic file under the execution program project directory, and obtain the path of the native component folder under the program project directory and the folder identifier of the third-party component folder by executing the logic file; based on the path of the native component folder, query the folder that matches the folder identifier of the third-party component folder in the native component folder to obtain the query result; when the query result indicates that there is no folder in the native component folder that matches the folder identifier of the third-party component folder, create a target folder in the native component folder whose folder identifier matches the folder identifier of the third-party component folder.

在一个实施例中,目标文件夹管理模块720还用于当查询结果表征原生组件文件夹中存在与第三方组件文件夹的文件夹标识匹配的文件夹,将与第三方组件文件夹的文件夹标识匹配的文件夹确定为目标文件夹。当目标文件夹中存在组件文件代码,将目标文件夹中存在的组件文件代码从目标文件夹删除;将第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,复制到目标文件夹中。In one embodiment, the target folder management module 720 is also used to determine the folder matching the folder identifier of the third-party component folder as the target folder when the query result indicates that there is a folder matching the folder identifier of the third-party component folder in the native component folder. When there is a component file code in the target folder, the component file code in the target folder is deleted from the target folder; and the component code file of at least one third-party page component in the third-party component folder is copied to the target folder.

在一个实施例中,第三方组件文件夹管理模块710还用于响应于安装第三方组件库的安装指令,确定程序项目目录下第三方文件夹中第三方组件库的组件包的第一版本标识;当通过第三方代码平台确定第一版本标识与第三方组件库最近一次更新的组件包的第二版本标识不匹配,从第三方代码平台中,获取第三方组件库在第二版本标识下的组件包,将获取的组件包存储至第三方文件夹中;将第三方文件夹中第三方组件库在第二版本标识下的组件包进行解压缩,将解压缩获得的第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中。In one embodiment, the third-party component folder management module 710 is also used to determine the first version identifier of the component package of the third-party component library in the third-party folder under the program project directory in response to an installation instruction for installing the third-party component library; when it is determined through the third-party code platform that the first version identifier does not match the second version identifier of the component package of the third-party component library that was most recently updated, obtain the component package of the third-party component library under the second version identifier from the third-party code platform, and store the obtained component package in the third-party folder; decompress the component package of the third-party component library under the second version identifier in the third-party folder, and store the component code file of each of at least one third-party page components in the decompressed third-party component library in the third-party component folder under the program project directory of the application.

在一个实施例中,页面组件处理装置700还包括渲染模块,渲染模块用于响应于渲染页面的页面渲染触发事件,获取页面的页面代码文件;当通过页面代码文件中的页面配置代码文件,对目标文件夹下至少一个第三方页面组件中的任一第三方页面组件注册有组件标签,且通过页面代码文件中的页面结构代码文件引用有组件标签,则确定页面代码文件引用有组件标签对应的第三方页面组件;根据页面代码文件,以及组件标签对应的第三方页面组件在目标文件夹下的组件代码文件,渲染页面。In one embodiment, the page component processing device 700 also includes a rendering module, which is used to obtain the page code file of the page in response to a page rendering trigger event of the rendered page; when a component tag is registered for any third-party page component in at least one third-party page component under the target folder through the page configuration code file in the page code file, and the component tag is referenced through the page structure code file in the page code file, it is determined that the page code file references the third-party page component corresponding to the component tag; render the page according to the page code file and the component code file of the third-party page component corresponding to the component tag under the target folder.

在一个实施例中,渲染模块还用于从页面代码文件的页面结构代码文件中,获取对组件标签对应的第三方页面组件的组件属性所赋的目标属性值;根据目标属性值,以及组件标签对应的第三方页面组件在目标文件夹下的组件代码文件,渲染页面。In one embodiment, the rendering module is also used to obtain the target attribute value assigned to the component attribute of the third-party page component corresponding to the component tag from the page structure code file of the page code file; render the page according to the target attribute value and the component code file of the third-party page component corresponding to the component tag in the target folder.

上述页面组件处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned page component processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图8所示。该计算机设备包括处理器、存储器、输入/输出接口、通信接口、显示单元和输入装置。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口、显示单元和输入装置通过输入/输出接口连接到系统总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、移动蜂窝网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种页面组件处理方法。该计算机设备的显示单元用于形成视觉可见的画面,可以是显示屏、投影装置或虚拟现实成像装置。显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input/output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input/output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input/output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a page component processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

在一个实施例中,还提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现上述各方法实施例中的步骤。In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要符合相关规定。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims (10)

1.一种页面组件处理方法,其特征在于,所述方法包括:1. A page component processing method, characterized in that the method comprises: 响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中;In response to an installation instruction for installing a third-party component library, storing a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application; 响应于执行所述程序项目目录下预配置的逻辑文件的执行指令,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹;In response to an execution instruction of a preconfigured logic file under the program project directory, determining a target folder matching the third-party component folder in a native component folder under the program project directory by executing the logic file; 将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中;所述目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在所述应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染所述应用程序的所述页面时,根据所述页面代码文件以及引用的第三方组件的组件代码文件,渲染所述页面。The component code file of at least one third-party page component in the third-party component folder is stored in the target folder; the component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application when the page code file of the page in the application references any third-party page component. 2.根据权利要求1所述的方法,其特征在于,所述响应于执行所述程序项目目录下预配置的逻辑文件的执行指令,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹,包括:2. The method according to claim 1, characterized in that, in response to executing an execution instruction of a preconfigured logic file in the program project directory, determining a target folder matching the third-party component folder in a native component folder in the program project directory by executing the logic file comprises: 响应于执行所述程序项目目录下预配置的逻辑文件的执行指令,通过执行所述逻辑文件,获取所述程序项目目录下的原生组件文件夹的路径,并获取所述第三方组件文件夹的文件夹标识;In response to an execution instruction of executing a preconfigured logic file in the program project directory, the path of the native component folder in the program project directory is obtained by executing the logic file, and the folder identifier of the third-party component folder is obtained; 基于所述原生组件文件夹的路径,在所述原生组件文件夹中,查询与所述第三方组件文件夹的文件夹标识匹配的文件夹,获得查询结果;Based on the path of the native component folder, in the native component folder, searching for a folder matching the folder identifier of the third-party component folder to obtain a query result; 当所述查询结果表征所述原生组件文件夹中不存在与所述第三方组件文件夹的文件夹标识匹配的文件夹,在所述原生组件文件夹中,创建文件夹标识与所述第三方组件文件夹的文件夹标识匹配的目标文件夹。When the query result indicates that there is no folder in the native component folder that matches the folder identifier of the third-party component folder, a target folder whose folder identifier matches the folder identifier of the third-party component folder is created in the native component folder. 3.根据权利要求2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 2, characterized in that the method further comprises: 当所述查询结果表征所述原生组件文件夹中存在与所述第三方组件文件夹的文件夹标识匹配的文件夹,将与所述第三方组件文件夹的文件夹标识匹配的文件夹确定为目标文件夹;When the query result indicates that there is a folder in the native component folder that matches the folder identifier of the third-party component folder, determining the folder that matches the folder identifier of the third-party component folder as the target folder; 所述将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中,包括:The storing the component code file of at least one third-party page component in the third-party component folder into the target folder includes: 当所述目标文件夹中存在组件文件代码,将所述目标文件夹中存在的组件文件代码从所述目标文件夹删除;When there is a component file code in the target folder, deleting the component file code in the target folder from the target folder; 将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,复制到所述目标文件夹中。Copy the component code file of at least one third-party page component in the third-party component folder to the target folder. 4.根据权利要求1所述方法,其特征在于,所述响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中,包括:4. The method according to claim 1, wherein, in response to an installation instruction for installing a third-party component library, storing a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application program comprises: 响应于安装第三方组件库的安装指令,确定所述程序项目目录下第三方文件夹中所述第三方组件库的组件包的第一版本标识;In response to an installation instruction for installing a third-party component library, determining a first version identifier of a component package of the third-party component library in a third-party folder under the program project directory; 当通过第三方代码平台确定第一版本标识与所述第三方组件库最近一次更新的组件包的第二版本标识不匹配,从所述第三方代码平台中,获取所述第三方组件库在所述第二版本标识下的组件包,将获取的组件包存储至所述第三方文件夹中;When it is determined through the third-party code platform that the first version identifier does not match the second version identifier of the component package of the most recently updated component library of the third-party component library, obtaining the component package of the third-party component library under the second version identifier from the third-party code platform, and storing the obtained component package in the third-party folder; 将所述第三方文件夹中所述第三方组件库在所述第二版本标识下的组件包进行解压缩,将解压缩获得的所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中。Decompress the component package of the third-party component library under the second version identifier in the third-party folder, and store the component code files of at least one third-party page component in the third-party component library obtained by decompression in the third-party component folder under the program project directory of the application. 5.根据权利要求1至4任一项所述的方法,其特征在于,所述方法还包括:5. The method according to any one of claims 1 to 4, characterized in that the method further comprises: 响应于渲染所述页面的页面渲染触发事件,获取所述页面的页面代码文件;In response to a page rendering trigger event for rendering the page, obtaining a page code file of the page; 当通过所述页面代码文件中的页面配置代码文件,对所述目标文件夹下至少一个第三方页面组件中的任一第三方页面组件注册有组件标签,且通过所述页面代码文件中的页面结构代码文件引用有所述组件标签,则确定所述页面代码文件引用有所述组件标签对应的第三方页面组件;When a component tag is registered for any third-party page component in at least one third-party page component under the target folder through a page configuration code file in the page code file, and the component tag is referenced through a page structure code file in the page code file, it is determined that the page code file references the third-party page component corresponding to the component tag; 根据所述页面代码文件,以及所述组件标签对应的第三方页面组件在所述目标文件夹下的组件代码文件,渲染所述页面。The page is rendered according to the page code file and the component code file of the third-party page component corresponding to the component tag in the target folder. 6.根据权利要求5所述的方法,其特征在于,所述根据所述页面代码文件,以及所述组件标签对应的第三方页面组件在所述目标文件夹下的组件代码文件,渲染所述页面,包括:6. The method according to claim 5, characterized in that the rendering of the page according to the page code file and the component code file of the third-party page component corresponding to the component tag in the target folder comprises: 从所述页面代码文件的所述页面结构代码文件中,获取对所述组件标签对应的第三方页面组件的组件属性所赋的目标属性值;acquiring, from the page structure code file of the page code file, a target attribute value assigned to a component attribute of a third-party page component corresponding to the component tag; 根据所述目标属性值,以及所述组件标签对应的第三方页面组件在所述目标文件夹下的组件代码文件,渲染所述页面。The page is rendered according to the target attribute value and the component code file of the third-party page component corresponding to the component tag in the target folder. 7.一种页面组件处理装置,其特征在于,所述装置包括:7. A page component processing device, characterized in that the device comprises: 第三方组件文件夹管理模块,用于响应于安装第三方组件库的安装指令,将所述第三方组件库中至少一个第三方页面组件各自的组件代码文件,存储至应用程序的程序项目目录下的第三方组件文件夹中;A third-party component folder management module, configured to store a component code file of at least one third-party page component in the third-party component library in a third-party component folder under a program project directory of the application program in response to an installation instruction for installing the third-party component library; 目标文件夹管理模块,用于响应于执行所述程序项目目录下预配置的逻辑文件的执行指令 ,通过执行所述逻辑文件,在所述程序项目目录下的原生组件文件夹中,确定与所述第三方组件文件夹匹配的目标文件夹;将所述第三方组件文件夹中至少一个第三方页面组件各自的组件代码文件,存储至所述目标文件夹中;所述目标文件夹中至少一个第三方页面组件各自的组件代码文件,用于在所述应用程序中页面的页面代码文件引用有任一第三方页面组件的情况下,在渲染所述应用程序的所述页面时,根据所述页面代码文件以及引用的第三方组件的组件代码文件,渲染所述页面。A target folder management module is used to respond to an execution instruction of a preconfigured logic file under the program project directory, determine a target folder matching the third-party component folder in a native component folder under the program project directory by executing the logic file; store a component code file of at least one third-party page component in the third-party component folder in the target folder; and a component code file of at least one third-party page component in the target folder is used to render the page according to the page code file and the component code file of the referenced third-party component when rendering the page of the application program, when the page code file of the page in the application program references any third-party page component. 8.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至6中任一项所述的方法的步骤。8. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。9. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented. 10.一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。10. A computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
CN202410379475.XA 2024-03-29 2024-03-29 Page component processing method, device, computer equipment, storage medium and product Pending CN118192965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410379475.XA CN118192965A (en) 2024-03-29 2024-03-29 Page component processing method, device, computer equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410379475.XA CN118192965A (en) 2024-03-29 2024-03-29 Page component processing method, device, computer equipment, storage medium and product

Publications (1)

Publication Number Publication Date
CN118192965A true CN118192965A (en) 2024-06-14

Family

ID=91402385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410379475.XA Pending CN118192965A (en) 2024-03-29 2024-03-29 Page component processing method, device, computer equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN118192965A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118409745A (en) * 2024-07-04 2024-07-30 烟台海颐软件股份有限公司 Two-way visual conversion system and method based on VUE technology

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118409745A (en) * 2024-07-04 2024-07-30 烟台海颐软件股份有限公司 Two-way visual conversion system and method based on VUE technology
CN118409745B (en) * 2024-07-04 2024-10-11 烟台海颐软件股份有限公司 Two-way visual conversion system and method based on VUE technology

Similar Documents

Publication Publication Date Title
CN104793946B (en) Dispositions method and system are applied based on cloud computing platform
US9258668B2 (en) Mobile application framework extensibiilty
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
US12010165B2 (en) Cross-platform module for loading across a plurality of device types
CN104090749A (en) Processing method and system for updating and changing interface theme of WinCE product
CN108287722A (en) A kind of decoupling method of Android application
CN106257418A (en) For by using assistance application to evaluate the technology of application
CN112068820A (en) Configuration processing method and device of microservice, computer equipment and storage medium
CN118192965A (en) Page component processing method, device, computer equipment, storage medium and product
CN111930455A (en) Page updating method, device, terminal and storage medium
CN112235132A (en) Method, device, medium and server for dynamically configuring service
US20110231837A1 (en) Virtual application package reconstitution
JP6002302B2 (en) Web application generation system, Web application generation system control method, Web application generation system program, Web application generation device, Web application generation device control method, and Web application generation device program
CN110989986A (en) Software template-based software generation method and device and computer equipment
CN118192972A (en) Page processing method, device, computer equipment, storage medium and program product
CN115543486B (en) Cold start delay optimization method, device and equipment for serverless computing
CN115904387A (en) Program module compiling method, computer device, and program product
CN115509634A (en) Input method configuration method, character input method, device and medium
CN116048609A (en) Configuration file updating method, device, computer equipment and storage medium
CN115509639A (en) Page loading method and device, electronic equipment and computer readable storage medium
CN114860202A (en) Project operation method, device, server and storage medium
CN104715056B (en) A kind of method and apparatus using Lifetime of Web Pages optimization application
CN111949309A (en) Method and device for pulling IDL file, computer equipment and storage medium
US7702890B2 (en) Information processing apparatus and program
CN118642708B (en) Page navigation method, computer program product, device, storage medium and computer equipment

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
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: Building A1, 37th Floor, Zhong'an Chuanggu Science and Technology Park, No. 900 Wangjiang West Road, Shushan District, Hefei City, Anhui Province, China 230031

Applicant after: Anhui Yilu Weixing Technology Co.,Ltd.

Address before: 230000, Floor 37, Building A1, Zhong'an Chuanggu Science and Technology Park, No. 900 Wangjiang West Road, High tech Zone, Hefei Area, China (Anhui) Pilot Free Trade Zone, Hefei City, Anhui Province

Applicant before: Anhui Gaodeng Weixing Technology Co.,Ltd.

Country or region before: China