A page generation method, platform, device and medium based on VUE
Through the VUE-based page generation method, the designer's drag configuration and component reuse function is used to solve the problem of component reuse and code specification in the traditional development mode, and achieve rapid page generation and efficient development, reducing R&D costs and improving Development efficiency.
Patent Information
- Application Number
- CN202111657858.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-12-30
AI Technical Summary
Under the traditional development model, due to the differences in the front-end technology stack, UI framework and personal writing habits, it is difficult to reuse duplicate functional components and difficult to unify the code format specifications, resulting in high project development costs and long cycles.
VUE-based page generation method, through the designer's component list area, page display area and component configuration area, developers can drag components to configure, generate page configuration objects, and save page content as templates to improve component reuse rate , lower the coding threshold.
It realizes rapid reuse of components and page generation, reduces development costs, improves development efficiency, and component attribute modifications take effect in real time to adapt to business diversity.
Smart Images

Figure CN114510233B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a VUE-based page generation method, device, equipment and medium. Background Art
[0002] With the development of the times, the front-end technology and frameworks are constantly updated, and the technology stacks that can be used for development projects are becoming more and more abundant. Under the traditional development model, due to the differences in the front-end technology stacks and UI frameworks that developers are familiar with, as well as the differences in personal coding habits, repeated functional components are difficult to reuse, and the code format specifications in multi-person projects are difficult to unify and maintain, resulting in high project development costs and long cycles. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a page generation method, device, equipment and medium based on VUE. Developers only need to drag the built-in components of the platform to the page display area for configuration to conveniently and quickly generate a page. At the same time, the existing control functions are repackaged and integrated, and some reusable content in the page can be saved as a template for use by other pages or developers, which greatly improves the reuse rate of components.
[0004] In a first aspect, the present invention provides a VUE-based page generation method, comprising:
[0005] The project establishment process: establishing a project based on the developer's operation and generating basic information of the project;
[0006] The page design process: when entering the designer design page from the project, a page configuration object is generated to store the project information and a component array to which the page belongs; the designer has a component list area, a page display area and a component configuration area. When a component in the component list area is dragged into the page display area, the component configuration area will display the properties of the corresponding selected component for configuration, and then the js object corresponding to the component is inserted into the component array of the page configuration object. The page display area finds the corresponding component from the encapsulated components according to the component type according to the component array of the page configuration object and renders the corresponding element according to the properties of the component;
[0007] Static file generation process: prepare a basic front-end packaging project in advance, and extract the page configuration information of each page of the project and parse it one by one to generate a standard vue file; when the vue files of all pages of the project are generated, count the component types used by all pages of the project, and generate a configuration file based on the basic information of the project. According to the component type statistics, dynamically execute the command to install the project dependency package, and execute the packaging command after all the project dependency packages are installed, so as to generate the static file of the project package and provide it to the developer for download;
[0008] Reuse preparation process: export the vue file to the corresponding local packaging project for secondary development, or store the page in the platform for modification and adjustment of the page.
[0009] In a second aspect, the present invention provides a VUE-based page generation device, comprising:
[0010] The project creation module creates a project based on the developer's operations and generates basic project information;
[0011] The designer is used by developers to design pages and generate a page configuration object for storing project information and a component array to which the page belongs; the designer has a component list area, a page display area and a component configuration area. When a component in the component list area is dragged into the page display area, the component configuration area will display the properties of the corresponding selected component for configuration, and then the js object corresponding to the component will be inserted into the component array of the page configuration object. The page display area will find the corresponding component from the encapsulated components according to the component type according to the component array of the page configuration object and render the corresponding element according to the properties of the component;
[0012] Static file generation module: used to prepare a basic front-end packaging project in advance, and extract the page configuration information of each page of the project and parse it one by one to generate a standard vue file; when the vue files of all pages of the project are generated, the component types used by all pages of the project are counted, and a configuration file is generated according to the basic information of the project. According to the component type statistics, the command to install the project dependency package is dynamically executed, and the packaging command is executed after all the dependent packages of the project are installed, so as to generate the static file of the project package and provide it to the developer for download;
[0013] The reuse preparation module is used to export the vue file to the corresponding local packaging project for secondary development, or store the page in the platform for modification and adjustment of the page.
[0014] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0015] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0016] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: a platform is implemented based on the front-end framework technology stack of VUE and ant-design-vue, and the existing control functions are repackaged and integrated. Developers only need to drag the built-in components of the platform to the page display area for configuration to easily and quickly generate a page, and some reusable content in the page can be saved as templates for other pages or developers to use, so as to improve the reuse rate of components. Modifications to component properties are effective in real time, which makes it easy to adjust the page according to needs at any time, and since pages can be generated by simply dragging and dropping configurations, the coding threshold of developers is greatly reduced, and the provision of custom script writing also meets the diversity of business. This achieves project standardization while reducing R&D costs and improving development efficiency.
[0017] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0019] Figure 1 is an overall flow chart of the method in Embodiment 1 of the present invention;
[0020] Figure 2 is a flow chart of a page generation process according to an embodiment of the present invention;
[0021] Figure 3 A flowchart of a page design process according to an embodiment of the present invention;
[0022] Figure 4 A flowchart of a static file generation process according to an embodiment of the present invention;
[0023] Figure 5 It is a structural schematic diagram of the device in the second embodiment of the present invention;
[0024] Figure 6This is a schematic diagram of the structure of an electronic device in Embodiment 3 of the present invention;
[0025] Figure 7 Schematic diagram of the structure of the medium in the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0026] The embodiments of the present application provide a VUE-based page generation method, apparatus, device and medium. Developers only need to drag the built-in components of the platform to the page display area for configuration to conveniently and quickly generate a page. At the same time, the existing control functions are repackaged and integrated, and some reusable content in the page can be saved as a template for use by other pages or developers, which greatly improves the reuse rate of components.
[0027] The technical solution in the embodiment of the present application has the following general idea: a platform is implemented based on the front-end framework technology stack of VUE and ant-design-vue, and the designer interface of the platform is divided into a component list area, a page display area, and a component configuration area; developers only need to drag the components in the component list to the page display area to assemble the overall structural content of the page display, click the component in the page display area to select the component, and the component configuration area will display the configuration details of the corresponding selected component and provide changes. After configuring a complete page, the page can be converted into a specific vue file according to the configuration of the current page and exported to the corresponding local packaged project for secondary development. The page can also be stored in the platform to modify and adjust the page at any time and package it into a project for export, so that repeated functional components are easy to reuse, and to a certain extent, the style specifications of the front-end code are unified, the coding threshold for developers is lowered, and the efficiency of page development is improved to achieve the purpose of reducing costs and improving efficiency.
[0028] Embodiment 1
[0029] like Figure 1 and Figure 2 As shown, this embodiment provides a page generation method based on VUE, including:
[0030] Project establishment process: Establish a project based on the developer's operations and generate basic project information; this process is mainly to provide a basis for subsequent packaging and generation of projects, including but not limited to generating basic information such as the overall layout, icons, titles, menus, and pages configured under the project, and providing functions for managing project members and viewing project dynamics, agreeing which developers can view and modify pages in the project, and finally generating a configuration file based on the project information when packaging the project, providing the generated project with layout icons for reading and displaying the project.
[0031] Page design process: Figure 3As shown, after the developer establishes a project on the platform, he can enter the designer interface from the project to design the page. When the developer enters the designer from the project to design a page, a page configuration object is generated to store the project information and a component array to which the page belongs; the designer has a component list area, a page display area and a component configuration area. When the component in the component list area is dragged into the page display area by the developer, the component configuration area will display the properties of the corresponding selected component for configuration, and then the js object corresponding to the component is inserted into the component array of the page configuration object. The page display area finds the corresponding component from the encapsulated components according to the component type according to the component array of the page configuration object and renders the corresponding element according to the component properties; wherein, the designer of the platform encapsulates a set of corresponding components according to the built-in ant-design-vue, and stipulates some default properties of these components, which are generated as js objects and stored in the platform, and each js object corresponds to a component in the component list area.
[0032] Static file generation process: Figure 4 As shown, developers can package all configured pages in the project to generate static files. The platform will prepare a basic front-end packaging project in advance, and extract the page configuration information of each page of the project and parse it one by one to generate a standard vue file; when the vue files of all pages of the project are generated, the component types used by all pages of the project are counted, and a configuration file is generated according to the basic information of the project. According to the statistical results of the component types, the command to install the project dependency package is dynamically executed, which can reduce the size of the packaged file caused by the installation of unnecessary dependency packages in the project. After all the dependency packages of the project are installed, the packaging command is executed to generate the static file of the project package and provide it to the developer for download;
[0033] Reuse preparation process: export the vue file to the corresponding local packaging project for secondary development, or store the page in the platform for modification and adjustment of the page.
[0034] As a better or more specific implementation of this embodiment, the method further includes:
[0035] Secondary development process: directly modify the vue file exported to the local computer, and then package it locally;
[0036] Page modification process: If you want to modify the display and interaction effects of components, you can select the component to be modified in the page display area. When the component in the page display area is selected, the component is set as the currently activated component, and the properties on the js object corresponding to the component are displayed in the component configuration area for configuration; when the configuration properties in the component configuration area are reconfigured, the configuration properties of the corresponding component in the page configuration object are changed synchronously, so that the page display area can dynamically render a new page; so that developers can develop a page in the platform designer only by dragging and dropping and changing the configuration of some properties.
[0037] Script customization process: When the platform may not be able to fully cover some complex business functions, the component configuration area provides developers with the ability to write custom scripts. When developers write custom scripts in the component configuration area, they store the custom scripts in the configuration object of the page according to the component ID. After the page is rendered, the component can find the corresponding custom script in the corresponding event according to the ID and execute it. A set of built-in APIs is also provided for developers to customize the action logic of interaction between components. This can reduce the amount of script writing by developers while providing developers with the ability to customize the action logic interaction of some components, and standardize the writing style of custom scripts.
[0038] String generation process: pre-define the method of generating strings for each component, generate strings according to the type and configuration properties of the js object, and then pass them into the backend interface after piecing together the complete page string, so that the backend can generate the corresponding vue file in the page directory corresponding to the front-end packaged project according to the string.
[0039] Based on the same inventive concept, the present application also provides a device corresponding to the method in Example 1, see Example 2 for details.
[0040] Embodiment 2
[0041] like Figure 5 As shown, in this embodiment, a VUE-based page generation device is provided, including:
[0042] The project establishment module establishes the project based on the developer's operations and generates the basic information of the project. The project establishment module is mainly to provide a basis for the subsequent packaging and generation of the project, including but not limited to the overall layout, icon, title, menu and pages configured under the project, and other basic information. It also provides the functions of managing project members and viewing project dynamics, and stipulates which developers can view and modify the pages in the project. When the project is finally packaged, a configuration file will be generated based on the project information, and the generated project will be provided with the layout icon for reading and displaying the project.
[0043] The designer generates a page configuration object for storing project information and a component array to which the page belongs when the developer designs a page; the designer has a component list area, a page display area and a component configuration area. When a component in the component list area is dragged into the page display area by the developer, the component configuration area will display the properties of the corresponding selected component for configuration, and then the js object corresponding to the component will be inserted into the component array of the page configuration object. The page display area will find the corresponding component from the encapsulated components according to the component type according to the component array of the page configuration object and render the corresponding element according to the properties of the component; the designer encapsulates a set of corresponding components based on the built-in ant-design-vue, and stipulates some default properties of these components, which are generated as js objects and stored in the platform. Each js object corresponds to a component in the component list area.
[0044] Static file generation module: used to prepare a basic front-end packaging project in advance, and extract the page configuration information of each page of the project and parse it one by one to generate a standard vue file; when the vue files of all pages of the project are generated, the component types used by all pages of the project are counted, and a configuration file is generated according to the basic information of the project. According to the component type statistics, the command to install the project dependency package is dynamically executed, and the packaging command is executed after all the dependent packages of the project are installed, so as to generate the static file of the project package and provide it to the developer for download;
[0045] Reuse preparation process: export the vue file to the corresponding local packaging project for secondary development, or store the page in the platform for modification and adjustment of the page.
[0046] As a better or more specific implementation of this embodiment, the device further includes:
[0047] The secondary development module allows developers to directly modify the vue files exported to the local computer and then package them locally;
[0048] Page modification module, when a component in the page display area is selected, the component is set as the currently activated component, and the properties on the js object corresponding to the component are displayed in the component configuration area for configuration; when the configuration properties in the component configuration area are reconfigured, the configuration properties of the corresponding component in the page configuration object are changed synchronously, so that the page display area can dynamically render a new page;
[0049] Script customization module. When developers write custom scripts in the component configuration area, the custom scripts are stored in the configuration object of the page according to the component ID. After the page is rendered, the component can find the corresponding custom script in the corresponding event according to the ID and execute it. A set of built-in APIs is also provided for developers to customize the action logic of interaction between components.
[0050] The string generation module predefines the method of generating strings for each component. It generates strings according to the type and configuration properties of the js object, and then assembles them into a complete page string and passes it to the backend interface so that the backend can generate the corresponding vue file in the page directory corresponding to the front-end packaged project based on the string.
[0051] Since the device introduced in the second embodiment of the present invention is a device used to implement the method of the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device based on the method introduced in the first embodiment of the present invention, so it is not described here in detail. All devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.
[0052] Based on the same inventive concept, the present application provides an electronic device embodiment corresponding to the first embodiment, see the third embodiment for details.
[0053] Embodiment 3
[0054] This embodiment provides an electronic device, such as Figure 6 As shown, it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any implementation method in the first embodiment can be implemented.
[0055] Since the electronic device introduced in this embodiment is a device used to implement the method in the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the device used by the method in the embodiment of the present application, it belongs to the scope of protection of the present application.
[0056] Based on the same inventive concept, the present application provides a storage medium corresponding to the first embodiment, see the fourth embodiment for details.
[0057] Embodiment 4
[0058] This embodiment provides a computer-readable storage medium, such as Figure 7 As shown, a computer program is stored thereon, and when the computer program is executed by a processor, any implementation method in Example 1 can be implemented.
[0059] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages: a platform is implemented based on the front-end framework technology stack of VUE and ant-design-vue, and the existing control functions are repackaged and integrated. Developers only need to drag the built-in components of the platform to the page display area for configuration, and a page can be generated conveniently and quickly, and some reusable content in the page can be saved as a template for other pages or developers to use, so as to improve the reuse rate of components. Modifications to component properties are effective in real time, which is convenient for adjusting pages according to needs at any time, and since pages can be generated by simply dragging and dropping configurations, the coding threshold of developers is greatly reduced, and the provision of custom script writing also meets the diversity of business. This achieves project standardization while reducing R&D costs and improving development efficiency.
[0060] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices or systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0061] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0062] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0064] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A page generation method based on VUE, Features: include: Project establishment process: Establish a project based on the developer's operations and generate basic project information; Page design process: When a developer enters the designer from a project to design a page, a page configuration object is generated to store the project information to which the page belongs and a component array; The designer has a component list area, a page display area and a component configuration area. When a component in the component list area is dragged into the page display area, the component configuration area will display the properties of the corresponding selected component for configuration, and then the js object corresponding to the component will be inserted into the component array of the page configuration object. The page display area will find the corresponding component from the encapsulated components according to the component type according to the component array of the page configuration object and render the corresponding element according to the properties of the component; Static file generation process: prepare a basic front-end packaging project in advance, and extract the page configuration information of each page of the project and parse it one by one to generate a standard vue file; when the vue files of all pages of the project are generated, count the component types used by all pages of the project, and generate a configuration file based on the basic information of the project. According to the component type statistics, dynamically execute the command to install the project dependency package, and execute the packaging command after all the project dependency packages are installed, so as to generate the static file of the project package and provide it to the developer for download; Reuse preparation process: export the vue file to the corresponding local packaging project for secondary development, or store the page in the platform for modification and adjustment of the page.
2. According to a VUE-based page generation method according to claim 1, Features: Also includes: Secondary development process: directly modify the vue file exported to the local computer, and then package it locally; Page modification process: When a component in the page display area is selected, the component is set as the currently activated component, and the properties on the js object corresponding to the component are displayed in the component configuration area for configuration; when the configuration properties in the component configuration area are reconfigured, the configuration properties of the corresponding component in the page configuration object are changed synchronously, so that the page display area can dynamically render a new page; Script customization process: When developers write custom scripts in the component configuration area, the custom scripts are stored in the configuration object of the page according to the component ID. After the page is rendered, the component can find the corresponding custom script in the corresponding event according to the ID and execute it. A set of built-in APIs is also provided for developers to customize the action logic of interaction between components.
3. According to a VUE-based page generation method according to claim 1, Features: Also includes: String generation process: pre-define the method of generating strings for each component, generate strings according to the type and configuration properties of the js object, and then pass them into the backend interface after piecing together the complete page string, so that the backend can generate the corresponding vue file in the page directory corresponding to the front-end packaged project according to the string.
4. According to a VUE-based page generation method according to claim 1, Features: The designer encapsulates a set of corresponding components based on ant-design-vue, and stipulates some default properties of these components, which are generated as js objects and stored in the platform. Each js object corresponds to a component in the component list area.
5. A page generation device based on VUE, Features: include: The project creation module creates a project based on the developer's operations and generates basic project information; The designer is used by developers to design pages and generate a page configuration object for storing project information and a component array to which the page belongs; the designer has a component list area, a page display area and a component configuration area. When a component in the component list area is dragged into the page display area, the component configuration area will display the properties of the corresponding selected component for configuration, and then the js object corresponding to the component will be inserted into the component array of the page configuration object. The page display area will find the corresponding component from the encapsulated components according to the component type according to the component array of the page configuration object and render the corresponding element according to the properties of the component; Static file generation module: used to prepare a basic front-end packaging project in advance, and extract the page configuration information of each page of the project and parse it one by one to generate a standard vue file; when the vue files of all pages of the project are generated, the component types used by all pages of the project are counted, and a configuration file is generated according to the basic information of the project. According to the component type statistics, the command to install the project dependency package is dynamically executed, and the packaging command is executed after all the dependent packages of the project are installed, so as to generate the static file of the project package and provide it to the developer for download; The reuse preparation module is used to export the vue file to the corresponding local packaging project for secondary development, or store the page in the platform for modification and adjustment of the page.
6. A VUE-based page generation device according to claim 5, Features: Also includes: The secondary development module allows developers to directly modify the vue files exported to the local computer and then package them locally; Page modification module, when a component in the page display area is selected, the component is set as the currently activated component, and the properties on the js object corresponding to the component are displayed in the component configuration area for configuration; when the configuration properties in the component configuration area are reconfigured, the configuration properties of the corresponding component in the page configuration object are changed synchronously, so that the page display area can dynamically render a new page; Script customization module. When developers write custom scripts in the component configuration area, the custom scripts are stored in the configuration object of the page according to the component ID. After the page is rendered, the component can find the corresponding custom script in the corresponding event according to the ID and execute it. A set of built-in APIs is also provided for developers to customize the action logic of interaction between components.
7. A VUE-based page generation device according to claim 5, Features: Also includes: The string generation module predefines the method of generating strings for each component. It generates strings according to the type and configuration properties of the js object, and then assembles them into a complete page string and passes it to the backend interface so that the backend can generate the corresponding vue file in the page directory corresponding to the front-end packaged project based on the string.
8. A VUE-based page generation device according to claim 5, Features: The designer encapsulates a set of corresponding components based on ant-design-vue, and stipulates some default properties of these components, which are generated as js objects and stored in the platform. Each js object corresponds to a component in the component list area.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
