CN107193554A - A kind of method and apparatus for generating front-end code - Google Patents
A kind of method and apparatus for generating front-end code Download PDFInfo
- Publication number
- CN107193554A CN107193554A CN201710289531.0A CN201710289531A CN107193554A CN 107193554 A CN107193554 A CN 107193554A CN 201710289531 A CN201710289531 A CN 201710289531A CN 107193554 A CN107193554 A CN 107193554A
- Authority
- CN
- China
- Prior art keywords
- code
- content element
- object content
- webpage
- display
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The disclosure is directed to a kind of method and apparatus for generating front-end code, belong to field of computer technology.Methods described includes:Receive in the selection instruction of the foundation code of correspondence object content element, the foundation code and include at least one view parameter;The foundation code of the object content element prestored is obtained, the parameter value of the view parameter inputted according to the foundation code and user generates the display code of the object content element;According to the display code of the object content element, the front-end code of the affiliated webpage of object content element is generated.Using the disclosure, the efficiency of generation front-end code can be improved.
Description
Technical field
The disclosure is directed to field of computer technology, especially with respect to a kind of method and apparatus for generating front-end code.
Background technology
With the development of Internet technology, the application of internet is more and more extensive, and increasing user can be by mutual
Networking carries out web page browsing.When user wants to browse certain webpage, user terminal can obtain the front end generation of the webpage from server
Code, user terminal runs the front-end code, to show the webpage.Webpage is generally made up of multiple content elements, such as picture, table
Lattice and input frame etc., wherein, front-end code includes the display code of each content element in webpage.
Technical staff is when writing front-end code, it is necessary to which for each content element in webpage, its correspondence is write respectively
Display code, so as to obtain the front-end code of the webpage.For example, including two forms and a picture, skill for certain webpage
Art personnel need to write the corresponding display code of two forms, and the corresponding display code of picture, then according in these three
Hold the display code of element, obtain the front-end code of the webpage.
During the present invention is realized, inventor has found that prior art at least has problems with:
For each content element in webpage, its corresponding display code of manual compiling is required for, then can just be obtained
The front-end code of the webpage, causes to generate the less efficient of front-end code.
The content of the invention
In order to overcome problem present in correlation technique, present disclose provides a kind of method and dress for generating front-end code
Put.The technical scheme is as follows:
According to the first aspect of the embodiment of the present disclosure there is provided a kind of method for generating front-end code, methods described includes:
Receive and regarded in the selection instruction of the foundation code of correspondence object content element, the foundation code comprising at least one
Graph parameter;
The foundation code of the object content element prestored is obtained, is inputted according to the foundation code and user
The parameter value of the view parameter, generates the display code of the object content element;
According to the display code of the object content element, the front end generation of the affiliated webpage of object content element is generated
Code.
Optionally, the display code according to the object content element, generates the affiliated net of object content element
Before the front-end code of page, in addition to:
Based on the display code of the object content element, the object content element is shown.
So, can be when writing the display code of object content element, the object content element that preview is write out is improved
Consumer's Experience.
Optionally, the display code according to the object content element, generates the affiliated net of object content element
The front-end code of page, including:
By the display code of the object content element, it is added to other codes of the affiliated webpage of object content element
In, obtain the front-end code of the webpage.
This provides a kind of implementation of generation.
Optionally, the display code according to the object content element, generates the affiliated net of object content element
The front-end code of page, including:
Obtain the corresponding module's address of display code of the object content element;
In other codes that the module's address is added to the affiliated webpage of object content element, the webpage is obtained
Front-end code.
This provides a kind of implementation of generation.
Optionally, methods described also includes:
It is corresponding according to the display code of the object content element during the front-end code of the webpage is run
Module's address, obtains the display code of the object content element from server;
Display code and other described codes based on the object content element got, are shown to the webpage
Show.
According to the second aspect of the embodiment of the present disclosure there is provided a kind of device for generating front-end code, described device includes:
In receiving module, the selection instruction of the foundation code for receiving correspondence object content element, the foundation code
Include at least one view parameter;
First acquisition module, the foundation code for obtaining the object content element prestored, according to the base
The parameter value of plinth code and the view parameter of user's input, generates the display code of the object content element;
Generation module, for the display code according to the object content element, is generated belonging to the object content element
The front-end code of webpage.
Optionally, described device also includes:
First display module, for the display code based on the object content element, enters to the object content element
Row display.
Optionally, the generation module, is used for:
By the display code of the object content element, it is added to other codes of the affiliated webpage of object content element
In, obtain the front-end code of the webpage.
Optionally, the generation module, including:
Acquisition submodule, the corresponding module's address of display code for obtaining the object content element;
Add submodule, other codes for the module's address to be added to the affiliated webpage of object content element
In, obtain the front-end code of the webpage.
Optionally, described device also includes:
Second acquisition module, for during the front-end code of the webpage is run, according to object content member
The corresponding module's address of display code of element, obtains the display code of the object content element from server;
Second display module, for the display code based on the object content element got and other described generations
Code, shows to the webpage.
According to the third aspect of the embodiment of the present disclosure there is provided a kind of device for generating front-end code, described device includes:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
Receive and regarded in the selection instruction of the foundation code of correspondence object content element, the foundation code comprising at least one
Graph parameter;
The foundation code of the object content element prestored is obtained, is inputted according to the foundation code and user
The parameter value of the view parameter, generates the display code of the object content element;
According to the display code of the object content element, the front end generation of the affiliated webpage of object content element is generated
Code.
The technical scheme provided by this disclosed embodiment can include the following benefits:
In the embodiment of the present disclosure, receive and wrapped in the selection instruction of the foundation code of correspondence object content element, foundation code
Containing at least one view parameter, the foundation code of the object content element prestored is obtained, it is defeated according to foundation code and user
The parameter value of the view parameter entered, generates the display code of object content element, according to the display code of object content element, raw
Into the front-end code of the affiliated webpage of object content element, so, it can be inputted according to the foundation code of default storage and user
The parameter value of view parameter, the display code of automatically generated content element writes the aobvious of each content element without user respectively
Show code, improve the efficiency of generation front-end code.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not
The disclosure can be limited.
Brief description of the drawings
Accompanying drawing herein is merged in specification and constitutes the part of this specification, shows the implementation for meeting the disclosure
Example, and be used to together with specification to explain the principle of the disclosure.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the method for generation front-end code according to an exemplary embodiment;
Fig. 2 is a kind of interface display schematic diagram according to an exemplary embodiment;
Fig. 3 is a kind of interface display schematic diagram according to an exemplary embodiment;
Fig. 4 is a kind of interface display schematic diagram according to an exemplary embodiment;
Fig. 5 is a kind of schematic diagram of the device of generation front-end code according to an exemplary embodiment;
Fig. 6 is a kind of schematic diagram of the device of generation front-end code according to an exemplary embodiment;
Fig. 7 is a kind of schematic diagram of the device of generation front-end code according to an exemplary embodiment;
Fig. 8 is a kind of schematic diagram of the device of generation front-end code according to an exemplary embodiment;
Fig. 9 is a kind of structural representation of terminal according to an exemplary embodiment.
Pass through above-mentioned accompanying drawing, it has been shown that the clear and definite embodiment of the disclosure, will hereinafter be described in more detail.These accompanying drawings
It is not intended to limit the scope that the disclosure is conceived by any mode with word description, but is by reference to specific embodiment
Those skilled in the art illustrate the concept of the disclosure.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to
During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended
The example of the consistent apparatus and method of some aspects be described in detail in claims, the disclosure.
The exemplary embodiment of the disclosure one provides a kind of method for generating front-end code, and this method can be used for terminal
In, wherein, the terminal can be PC ((personal computer, personal computer) terminal or mobile phone or flat board
The application program of front-end code for generating webpage can be provided with the mobile terminals such as computer, the terminal, and (such as certain is inserted
Part), user can generate the display code of each content element in webpage by the application program, and then generate the front end of the webpage
Code.User in the present embodiment is the user for writing front-end code, such as the technical staff of certain webpage.
Below in conjunction with embodiment, the handling process shown in Fig. 1 is described in detail, content can be as follows:
In a step 101, the selection instruction of the foundation code of correspondence object content element is received.
In force, user can install the application program of the front-end code for generating webpage in terminal, and this applies journey
The foundation code of default multiple content elements can be included in sequence.Wherein, the content element is the arbitrary content member in webpage
Element, such as title, picture, form and input frame etc..For example, the application program can include the foundation code of picture, list
Foundation code, foundation code of block diagram etc..Foundation code can be the most basic logical code for display content element
(can be described as model), for realize except the content element be particularly shown content in addition to view effect.For example, content element
For form, the view effect in addition to the particular content in the form can be realized by foundation code, such as the frame of form,
Size and color etc.;Content element is title, and the view effect beyond caption text, such as word can be realized by foundation code
Decorative picture of body, color and title etc..View at least one view parameter, foundation code can be included in foundation code to join
Several parameter values can be default initial value, or empty.For the foundation code of any content element, user can lead to
The parameter value of each view parameter inputted in the foundation code is crossed, content is particularly shown set the content element.Specifically
Extended meeting is described in detail after processing procedure.The foundation code of each content element can be advance by the developer of the application program
Write out, be stored in the application program.Wherein, for same content element, a variety of foundation codes, example can be provided with
Such as, for form, a variety of foundation codes can be set, to realize different display effects.
When user wants the front-end code for writing certain webpage, user can open the application program, Ran Hou in terminal
Opened in the application program for selecting the interface of foundation code (can be described as Code Selection interface).Can in the Code Selection interface
To show default foundation code list, as shown in Fig. 2 default each basic generation can be shown in the foundation code list
The mark of code, such as the title of foundation code can also show title of the corresponding content element of each foundation code etc..User thinks
When creating the display code of certain content element (i.e. object content element), can according to the need for oneself in foundation code list
The middle foundation code for selecting to need to use.Terminal can then receive to should foundation code selection instruction.User's selection
Foundation code can be a kind of or a variety of.
In a step 102, the foundation code of the object content element prestored is obtained, it is defeated according to foundation code and user
The parameter value of the view parameter entered, generates the display code of object content element.
In force, terminal is received to that should can show for inputting view ginseng after the selection instruction of foundation code
The foundation code institute can be shown in the interface (alternatively referred to as attributes edit interface) of several parameter values, the attributes edit interface
Comprising each view parameter, and the corresponding parameter value of each view parameter input frame.User can be in each view parameter pair
Input parameter value in the input frame answered, to set the display content of object content element.For example, object content element is form,
View parameter in foundation code includes title, field name and data type, wherein, title is the first row in form, word
Secondary series in Duan Mingwei forms, data type is the 3rd row in form, and corresponding attributes edit interface is as shown in figure 3, can
To show title, field name and data type by row, user can input the title, field name and data class of the first row respectively
The title, field name and data type of type, title, field name and the data type of the second row, and the third line, are obtained such as figure
Form shown in 4.In addition, being also provided with adding option in attributes edit interface, user can select to add option, input
The data of more multirow in more multilist.After the completion of user's input, it can click on and save options, what terminal can then be inputted to user
The parameter value of each view parameter is stored.
Terminal is received to that should can also obtain the object content element prestored after the selection instruction of foundation code
Foundation code, the parameter value for each view parameter that then can input user is passed in foundation code, in generation target
Hold the display code of element.Then display code conversion JS, HTML and CSS code can also will be converted obtained generation by terminal
Code is stored with document form.When user selects multiple foundation codes, user can input each foundation code respectively
In view parameter parameter value, terminal can then generate multigroup display code, then can be turned multigroup display code
Change, and the display code after conversion of packing, and stored with document form.In addition, terminal can also generate the mould of the display code
Block address, the module's address is the address for the online access display code, when terminal is loading the webpage, can be passed through
The module's address quotes the display code online.
Optionally, user is after the parameter value of input view parameter, and terminal can be with the preview graph of display target content element
Picture, corresponding processing procedure can be as follows:Display code based on object content element, shows to object content element.
In force, after the display code of terminal generation object content element, the display code can be run, to show mesh
The image of content element is marked, user then can intuitively see object content element, so that whether judge the parameter value of input has
By mistake.Terminal can receive user input whole parameter values after, object content element is shown, or, can also
After a parameter value is often received, just parameter value is passed in foundation code, then to the basis of the incoming parameter value
Code is shown, so that user can be with live preview object content element.
In step 103, according to the display code of object content element, the front end of the affiliated webpage of object content element is generated
Code.
In force, after the display code of terminal generation object content element, the affiliated net of object content element can be obtained
Page other codes, then according to the display code of object content element, and the affiliated webpage of object content element other generations
Code, generates the front-end code of the affiliated webpage of object content element.Specific generating process can be diversified, the present embodiment
There is provided two kinds of feasible processing modes.
Mode one, the display code by object content element, are added to other codes of the affiliated webpage of object content element
In, obtain the front-end code of webpage.
In force, user can write in the webpage in advance, other codes in addition to object content element, terminal life
Into after the display code of object content element, object content member can be added to automatically by the display code of object content element
In other codes of webpage belonging to plain, the front-end code of webpage is obtained.Or, terminal can be operated according to user, by target
Hold in the display code of element, other codes for being added to the affiliated webpage of object content element, for example, user can be by replicating
Operation, by the display Code copying to the specified location in other codes, or, user can input addition instruction, and this adds
Plus instruction includes the point of addition of the display code in other codes, terminal can then be instructed according to the addition, by target
In the display code of content element, other codes for being added to the affiliated webpage of object content element, so as to generate the front end of webpage
Code.
Mode two, the corresponding module's address of display code for obtaining object content element;Module's address is added to target
In other codes of the affiliated webpage of content element, the front-end code of webpage is obtained.
In force, terminal can also obtain the module's address of the display code previously generated, and except object content
Other codes beyond element, then can be added to other of the affiliated webpage of object content element automatically by the module's address
In code, the front-end code of webpage is obtained.Or, terminal can be operated according to user, and the module's address is added in target
In other codes for holding the affiliated webpage of element, for example, user can operate by replicating, the module's address is copied into other generations
Specified location in code, or, user can input addition instruction, and addition instruction includes the module's address in other generations
Point of addition in code, terminal can then be instructed according to the addition, and the module's address is added into the affiliated net of object content element
In other codes of page, so as to generate the front-end code of webpage.
Based on above-mentioned processing, it is possible to achieve code components, the reusability of code is greatly improved, user is before writing
When holding code, the parameter value of the view parameter simply entered, terminal just can with the display code of automatically generated content element, without
User writes a large amount of codes, convenient and swift, and operating process is very simple, can greatly save human cost and time into
This.
Optionally, after the front-end code of terminal generation webpage, the front-end code of the webpage can be stored in the server,
So that the user terminal for desiring access to the webpage can obtain the front-end code of the webpage from server, so as to show the webpage.
For the front-end code of through the above way one generation, user terminal gets after the front-end code of the webpage, can directly transported
The row front-end code, shows the webpage, and for the front-end code of through the above way two generations, the processing procedure of user terminal can
With as follows:During the front-end code of operation webpage, according to the corresponding module's address of display code of object content element,
The display code of object content element is obtained from server;Display code based on the object content element got and other
Code, shows to webpage.
In force, the front-end code generated for aforesaid way two, user terminal is running the process of the front-end code
In, object content element can be obtained from server according to the corresponding module's address of display code of object content element
Show code.For example, above-mentioned terminal can generate the corresponding Json files of display code of object content element, user terminal is then
The Json files can be downloaded from server, then parsing the Json files by the parsing SDK prestored obtains module
Address, and then obtain the display code of object content element.User terminal can run the aobvious of the object content element that gets
Show other codes of code and the webpage, to show the webpage.
In the embodiment of the present disclosure, receive and wrapped in the selection instruction of the foundation code of correspondence object content element, foundation code
Containing at least one view parameter, the foundation code of the object content element prestored is obtained, it is defeated according to foundation code and user
The parameter value of the view parameter entered, generates the display code of object content element, according to the display code of object content element, raw
Into the front-end code of the affiliated webpage of object content element, so, it can be inputted according to the foundation code of default storage and user
The parameter value of view parameter, the display code of automatically generated content element writes the aobvious of each content element without user respectively
Show code, improve the efficiency of generation front-end code.
Disclosure further example embodiment, which is provided, additionally provides a kind of device for generating front-end code, as shown in figure 5,
The device includes:Receiving module 510, the first acquisition module 520 and generation module 550.
Receiving module 510, the selection instruction of the foundation code for receiving correspondence object content element, the foundation code
In include at least one view parameter;
First acquisition module 520, the foundation code for obtaining the object content element prestored, according to described
The parameter value of foundation code and the view parameter of user's input, generates the display code of the object content element;
Generation module 530, for the display code according to the object content element, generates the object content element institute
Belong to the front-end code of webpage.
Optionally, as shown in fig. 6, described device also includes:
First display module 540, for the display code based on the object content element, to the object content element
Shown.
Optionally, the generation module 530, is used for:
By the display code of the object content element, it is added to other codes of the affiliated webpage of object content element
In, obtain the front-end code of the webpage.
Optionally, as shown in fig. 7, the generation module 530, including:
Acquisition submodule 531, the corresponding module's address of display code for obtaining the object content element;
Add submodule 532, for by the module's address be added to the affiliated webpage of object content element other
In code, the front-end code of the webpage is obtained.
Optionally, as shown in figure 8, described device also includes:
Second acquisition module 550, for during the front-end code of the webpage is run, according to the object content
The corresponding module's address of display code of element, obtains the display code of the object content element from server;
Second display module 560, for the display code based on the object content element got and it is described other
Code, shows to the webpage.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant this method
Embodiment in be described in detail, explanation will be not set forth in detail herein.
In the embodiment of the present disclosure, receive and wrapped in the selection instruction of the foundation code of correspondence object content element, foundation code
Containing at least one view parameter, the foundation code of the object content element prestored is obtained, it is defeated according to foundation code and user
The parameter value of the view parameter entered, generates the display code of object content element, according to the display code of object content element, raw
Into the front-end code of the affiliated webpage of object content element, so, it can be inputted according to the foundation code of default storage and user
The parameter value of view parameter, the display code of automatically generated content element writes the aobvious of each content element without user respectively
Show code, improve the efficiency of generation front-end code.
It should be noted that:Above-described embodiment provide generation front-end code device generation front-end code when, only with
The division progress of above-mentioned each functional module is for example, in practical application, as needed can distribute above-mentioned functions by not
Same functional module is completed, i.e., the internal structure of equipment is divided into different functional modules, to complete whole described above
Or partial function.In addition, the device for the generation front-end code that above-described embodiment is provided and the method for generation front-end code are implemented
Example belongs to same design, and it implements process and refers to embodiment of the method, repeats no more here.
A kind of structural representation for terminal that the embodiment of the present disclosure is also illustrated.The terminal can be mobile phone or tablet personal computer etc.
Mobile terminal.Reference picture 9, terminal 800 can include following one or more assemblies:Processing assembly 802, memory 804, power supply
Component 806, multimedia groupware 808, audio-frequency assembly 810, the interface 812 of input/output (I/O), sensor cluster 814, and
Communication component 816.
The integrated operation of the usual control terminal 800 of processing assembly 802, such as with display, call, data communication, phase
Machine operates the operation associated with record operation.Treatment element 802 can refer to including one or more processors 820 to perform
Order, to complete all or part of step of above-mentioned method.In addition, processing assembly 802 can include one or more modules, just
Interaction between processing assembly 802 and other assemblies.For example, processing component 802 can include multi-media module, it is many to facilitate
Interaction between media component 808 and processing assembly 802.
Memory 804 is configured as storing various types of data supporting the operation in terminal 800.These data are shown
Example includes the instruction of any application program or method for being operated in terminal 800, and contact data, telephone book data disappears
Breath, picture, video etc..Memory 804 can be by any kind of volatibility or non-volatile memory device or their group
Close and realize, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM) is erasable to compile
Journey read-only storage (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, flash
Device, disk or CD.
Electric power assembly 806 provides electric power for the various assemblies of terminal 800.Electric power assembly 806 can include power management system
System, one or more power supplys, and other components associated with generating, managing and distributing electric power for audio output apparatus 800.
Multimedia groupware 808 is included in the screen of one output interface of offer between the terminal 800 and user.One
In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen
Curtain may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one or more touch sensings
Device is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or sliding action
Border, but also detection touches or slide related duration and pressure with described.In certain embodiments, many matchmakers
Body component 808 includes a front camera and/or rear camera.When terminal 800 be in operator scheme, such as screening-mode or
During video mode, front camera and/or rear camera can receive the multi-medium data of outside.Each front camera and
Rear camera can be a fixed optical lens system or with focusing and optical zoom capabilities.
Audio-frequency assembly 810 is configured as output and/or input audio signal.For example, audio-frequency assembly 810 includes a Mike
Wind (MIC), when audio output apparatus 800 is in operator scheme, when such as call model, logging mode and speech recognition mode, wheat
Gram wind is configured as receiving external audio signal.The audio signal received can be further stored in memory 804 or warp
Sent by communication component 816.
I/O interfaces 812 is provide interface between processing assembly 802 and peripheral interface module, above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock
Determine button.
Sensor cluster 814 includes one or more sensors, and the state for providing various aspects for terminal 800 is commented
Estimate.For example, sensor cluster 814 can detect opening/closed mode of terminal 800, the relative positioning of component is for example described
Component is the display and keypad of terminal 800, and sensor cluster 814 can also detect 800 1 components of terminal 800 or terminal
Position change, the existence or non-existence that user contacts with terminal 800, the orientation of terminal 800 or acceleration/deceleration and terminal 800
Temperature change.Sensor cluster 814 can include proximity transducer, be configured to detect in not any physical contact
The presence of neighbouring object.Sensor cluster 814 can also include optical sensor, such as CMOS or ccd image sensor, for into
As being used in application.In certain embodiments, the sensor cluster 814 can also include acceleration transducer, gyro sensors
Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 816 is configured to facilitate the communication of wired or wireless way between terminal 800 and other equipment.Terminal
800 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.In an exemplary implementation
In example, communication component 816 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel.
In one exemplary embodiment, the communication component 816 also includes near-field communication (NFC) module, to promote junction service.Example
Such as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology,
Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, terminal 800 can be believed by one or more application specific integrated circuits (ASIC), numeral
Number processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided
Such as include the memory 804 of instruction, above-mentioned instruction can be performed to complete the above method by the processor 820 of terminal 800.For example,
The non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk
With optical data storage devices etc..
In the embodiment of the present disclosure, receive and wrapped in the selection instruction of the foundation code of correspondence object content element, foundation code
Containing at least one view parameter, the foundation code of the object content element prestored is obtained, it is defeated according to foundation code and user
The parameter value of the view parameter entered, generates the display code of object content element, according to the display code of object content element, raw
Into the front-end code of the affiliated webpage of object content element, so, it can be inputted according to the foundation code of default storage and user
The parameter value of view parameter, the display code of automatically generated content element writes the aobvious of each content element without user respectively
Show code, improve the efficiency of generation front-end code.
Those skilled in the art will readily occur to its of the disclosure after considering specification and putting into practice disclosure disclosed herein
Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or
Person's adaptations follow the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by following
Claim is pointed out.
It should be appreciated that the precision architecture that the disclosure is not limited to be described above and is shown in the drawings, and
And various modifications and changes can be being carried out without departing from the scope.The scope of the present disclosure is only limited by appended claim.
Claims (11)
1. a kind of method for generating front-end code, it is characterised in that methods described includes:
Receive in the selection instruction of the foundation code of correspondence object content element, the foundation code comprising at least one view ginseng
Number;
The foundation code of the object content element prestored is obtained, according to the foundation code and user's input
The parameter value of view parameter, generates the display code of the object content element;
According to the display code of the object content element, the front-end code of the affiliated webpage of object content element is generated.
2. according to the method described in claim 1, it is characterised in that the display code according to the object content element,
Before the front-end code for generating the affiliated webpage of object content element, in addition to:
Based on the display code of the object content element, the object content element is shown.
3. according to the method described in claim 1, it is characterised in that the display code according to the object content element,
The front-end code of the affiliated webpage of object content element is generated, including:
By the display code of the object content element, in other codes for being added to the affiliated webpage of object content element,
Obtain the front-end code of the webpage.
4. according to the method described in claim 1, it is characterised in that the display code according to the object content element,
The front-end code of the affiliated webpage of object content element is generated, including:
Obtain the corresponding module's address of display code of the object content element;
In other codes that the module's address is added to the affiliated webpage of object content element, obtain before the webpage
Hold code.
5. method according to claim 4, it is characterised in that methods described also includes:
During the front-end code of the webpage is run, according to the corresponding module of display code of the object content element
Address, obtains the display code of the object content element from server;
Display code and other described codes based on the object content element got, show to the webpage.
6. a kind of device for generating front-end code, it is characterised in that described device includes:
Included in receiving module, the selection instruction of the foundation code for receiving correspondence object content element, the foundation code
At least one view parameter;
First acquisition module, the foundation code for obtaining the object content element prestored, according to the basic generation
The parameter value for the view parameter that code and user input, generates the display code of the object content element;
Generation module, for the display code according to the object content element, generates the affiliated webpage of object content element
Front-end code.
7. device according to claim 6, it is characterised in that described device also includes:
First display module, for the display code based on the object content element, is shown to the object content element
Show.
8. device according to claim 6, it is characterised in that the generation module, is used for:
By the display code of the object content element, in other codes for being added to the affiliated webpage of object content element,
Obtain the front-end code of the webpage.
9. device according to claim 6, it is characterised in that the generation module, including:
Acquisition submodule, the corresponding module's address of display code for obtaining the object content element;
Submodule is added, for the module's address to be added in other codes of the affiliated webpage of object content element,
Obtain the front-end code of the webpage.
10. device according to claim 9, it is characterised in that described device also includes:
Second acquisition module, for during the front-end code of the webpage is run, according to the object content element
The corresponding module's address of code is shown, the display code of the object content element is obtained from server;
Second display module, it is right for display code and other described codes based on the object content element got
The webpage is shown.
11. a kind of device for generating front-end code, it is characterised in that including:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
Receive in the selection instruction of the foundation code of correspondence object content element, the foundation code comprising at least one view ginseng
Number;
The foundation code of the object content element prestored is obtained, according to the foundation code and user's input
The parameter value of view parameter, generates the display code of the object content element;
According to the display code of the object content element, the front-end code of the affiliated webpage of object content element is generated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710289531.0A CN107193554A (en) | 2017-04-27 | 2017-04-27 | A kind of method and apparatus for generating front-end code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710289531.0A CN107193554A (en) | 2017-04-27 | 2017-04-27 | A kind of method and apparatus for generating front-end code |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107193554A true CN107193554A (en) | 2017-09-22 |
Family
ID=59872387
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710289531.0A Pending CN107193554A (en) | 2017-04-27 | 2017-04-27 | A kind of method and apparatus for generating front-end code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107193554A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107885533A (en) * | 2017-11-30 | 2018-04-06 | 广州酷狗计算机科技有限公司 | The method and device of management assembly code |
WO2019071895A1 (en) * | 2017-10-10 | 2019-04-18 | 平安科技(深圳)有限公司 | Data processing method for multiple associated business systems, electronic device and medium |
CN109725901A (en) * | 2018-05-31 | 2019-05-07 | 中国平安人寿保险股份有限公司 | Development approach, device, equipment and the computer storage medium of front-end code |
CN110147516A (en) * | 2019-04-15 | 2019-08-20 | 深圳壹账通智能科技有限公司 | The intelligent identification Method and relevant device of front-end code in Pages Design |
CN110321126A (en) * | 2019-07-08 | 2019-10-11 | 北京三快在线科技有限公司 | The method and apparatus for generating page code |
CN110489105A (en) * | 2019-07-19 | 2019-11-22 | 厦门美柚信息科技有限公司 | It is a kind of to visualize setting method, system, equipment and its storage medium buried a little |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120066585A1 (en) * | 2010-09-13 | 2012-03-15 | International Business Machines Corporation | Widget behavior customization via cascaded style sheets |
CN102681841A (en) * | 2012-02-01 | 2012-09-19 | 中兴通讯(香港)有限公司 | Method and system for developing mobile phone application |
CN104750793A (en) * | 2015-03-12 | 2015-07-01 | 小米科技有限责任公司 | Method and device for generating page tables |
-
2017
- 2017-04-27 CN CN201710289531.0A patent/CN107193554A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120066585A1 (en) * | 2010-09-13 | 2012-03-15 | International Business Machines Corporation | Widget behavior customization via cascaded style sheets |
CN102681841A (en) * | 2012-02-01 | 2012-09-19 | 中兴通讯(香港)有限公司 | Method and system for developing mobile phone application |
CN104750793A (en) * | 2015-03-12 | 2015-07-01 | 小米科技有限责任公司 | Method and device for generating page tables |
Non-Patent Citations (1)
Title |
---|
李晓慧 等编著: "《服装网络营销》", 31 October 2004, 中国纺织出版社 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019071895A1 (en) * | 2017-10-10 | 2019-04-18 | 平安科技(深圳)有限公司 | Data processing method for multiple associated business systems, electronic device and medium |
CN107885533A (en) * | 2017-11-30 | 2018-04-06 | 广州酷狗计算机科技有限公司 | The method and device of management assembly code |
CN109725901A (en) * | 2018-05-31 | 2019-05-07 | 中国平安人寿保险股份有限公司 | Development approach, device, equipment and the computer storage medium of front-end code |
CN109725901B (en) * | 2018-05-31 | 2024-03-29 | 中国平安人寿保险股份有限公司 | Front-end code development method, device, equipment and computer storage medium |
CN110147516A (en) * | 2019-04-15 | 2019-08-20 | 深圳壹账通智能科技有限公司 | The intelligent identification Method and relevant device of front-end code in Pages Design |
WO2020211380A1 (en) * | 2019-04-15 | 2020-10-22 | 深圳壹账通智能科技有限公司 | Intelligent recognition method for front-end code in page design, and related device |
CN110321126A (en) * | 2019-07-08 | 2019-10-11 | 北京三快在线科技有限公司 | The method and apparatus for generating page code |
CN110489105A (en) * | 2019-07-19 | 2019-11-22 | 厦门美柚信息科技有限公司 | It is a kind of to visualize setting method, system, equipment and its storage medium buried a little |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107193554A (en) | A kind of method and apparatus for generating front-end code | |
JP6393840B2 (en) | Information display method, apparatus, program, and recording medium | |
CN104536935B (en) | Calculate display methods, calculate edit methods and device | |
CN107423106A (en) | The method and apparatus for supporting more frame grammars | |
CN109683837A (en) | Multi-screen display method, device and storage medium | |
CN107066172A (en) | The document transmission method and device of mobile terminal | |
CN104111720B (en) | Control method of electronic device, device and electronic equipment | |
CN106569800A (en) | Front end interface generation method and apparatus | |
CN107241495A (en) | The split screen treating method and apparatus of terminal device | |
CN113238752B (en) | Code generation method, device, electronic equipment and storage medium | |
CN104636164B (en) | Start page generation method and device | |
CN104020990B (en) | Date selects control display methods and device | |
CN106791092A (en) | The searching method and device of contact person | |
CN106775202A (en) | A kind of method and device of information transfer | |
CN106791014A (en) | Message display method and device | |
CN106897937A (en) | A kind of method and apparatus for showing social sharing information | |
CN104536659B (en) | Object information processing method and device | |
CN104636170A (en) | Application acquiring method and device and electronic device | |
CN105955808B (en) | The task management method and device of instant messaging application | |
CN106503131A (en) | Obtain the method and device of interest information | |
CN106293961A (en) | Text message processing method and device | |
CN112581104A (en) | Information processing method, information processing apparatus, electronic device, storage medium, and program product | |
CN109725806A (en) | Website edit methods and device | |
CN104375760B (en) | Method for information display and device | |
CN104020972B (en) | Background display methods, device and electronic 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170922 |
|
RJ01 | Rejection of invention patent application after publication |