The invention discloses a
code generation method and device of a front-end component and a
computer program product. Relates to the field of front-end development, and comprises the following steps: responding to a dragging instruction of a user, dragging a front-end component to a
visual interface, responding to a configuration instruction of the user, configuring attributes, styles and events for the front-end component, and obtaining a configured front-end component, the front-end component comprising at least one of a button, a textbox, a card and a table; determining a first target
data model of the configured front-end component, and generating a front-end code of the first target
data model based on the component
knowledge base and the code generator; responding to a
natural language instruction for describing the
business logic of the front-end component by the user, and inputting the
natural language instruction into the large
language model to obtain a front-end logic code of the front-end component; and determining the front-end code and the front-end logic code as target codes of the front-end component. Through the method and the device, the problem of low
code development efficiency of the front-end component in related technologies is solved.