Backgroud

In the background management project, the most important business model abstracted out is nothing more than: add, delete, change, check (paging). There are a lot of similar code models in a project, and the best way is to extract the business model into a reusable component and use it through a configuration file. The emergence of "VUE component technology" and "MongoDB modeless database" make this idea possible:

Writing a configuration file contains the following contents:

  • Data entity name -->MongoDB collection name
  • Collection Definition - > collection format, index, page name, add, modify, input element type used
  • Data processing hook--> processing before submit, post processing.
  • Other

The front end generates each component dynamically according to this configuration file, and the back end updates the submitted data to MongoDB according to this configuration file.