Content in this paper,
- Function display.
- Plug-ins used in development.
Front end separation
Due to the popularity of VUE/React, the current development mode has become the front and back end separation, which requires fake data (data structure) in the early stage of front-end development.
My front end, every time the development are distressed at the above demand, so made the following small tools.
Brainless one key fake data, a total of 2 steps
Preview BMOCK online
The first step is to enter any JSON
Enter JSON(both JSON and JS objects are supported) and click OK.
Step two, the number of cycles
For fields of array type, set how many to generate.
Pay attention to: BMOCK automatically identifies the contents of the data, such as phone/email,None of this is set up, if you have special requirements, click Set to further narrow the range.
What plug-ins are used for development sharing?
Use 3 third-party plug-ins in the development, very powerful, share:
mockjs
Generating random data
import mockjs from 'mockjs';
// Generate a mobile phone number
mockjs.Random.phone();
Copy the code
file-saver
Saves text content to a file
import { saveAs } from 'file-saver';
const blob = new Blob(['hello'] and {type: 'text/plain; charset=utf-8'}); saveAs(blob,`1.mock.json`);
Copy the code
dayjs
Time formatting
dayjs().format('YYYY-MM-DD HH-mm-ss');
/ / the 2021-01-01 10:10:10
Copy the code
any-rule
The any-rule database is used to determine string content. github.com/any86/any-r…
In the late planning
-
Currently, it can only be saved as JSON files for offline use, but the next version implements online fake data structures that are more silly.
-
Add document function, support import and export.
Join us
If you also like this tool (based on vue+ iView), then join us to increase productivity github.com/any86/be-mo…