According to one aspect of the present application, a method for generating and updating front-end code is provided, the method comprising: determining feature information of components in a front-end design file and determining a feature
semantic tree based on the feature information, the feature information comprising visual feature information,
semantic feature information and interaction feature information; inputting the feature
semantic tree into a pre-trained model to obtain code of multiple framework types; creating a structured
directory corresponding to code of a target framework type among the code of the multiple framework types and assigning the code of the target framework type to the structured
directory to obtain structured code, optimizing and packaging the structured code to generate front-end code for deployment; and in response to an update instruction, determining a target update node in the feature
semantic tree corresponding to the update instruction to update front-end code associated with the target update node in the front-end code according to the update instruction.