Original link: https://zburu.com/archives/169.html
Last night, I wrote an oil monkey script for a friend. The scene is a form with many input boxes, mostly strings that are often filled in. I told me about it, I just had nothing to do, so I took two hours to come out after dinner and simply write.
The requirement is to preset multiple sets of templates. You can add content yourself later, put it on the blank space of the webpage, and click the button to fill the set text into the form of the webpage.
It is very simple to handle. I originally planned to use ajax to call the json file and write the template in json, so that it is clear at a glance and easy to add data later, but after the test, I found that the target website blocked external files, so I gave up this way of writing. Instead, an array is created, and each object is a set of templates. The next step is a simple loop, writing a zoomable pop-up window, and then binding the interactive button to the click event, and clicking the corresponding button will populate the website. A string for the opposite template.
The process is probably like this. After the end, I will polish it and write the CSS code. Overall, it’s not difficult, and it’s done in less than two hours.
However, I found that every day I write vue, I write a lot of elements, and the most basic js is a little rusty. For example, the operation of arrays is traversed and looped, and an error is reported in the middle. After careful inspection, I find the reason, which is really not right.
Deeply reflect on yourself, the basic knowledge still needs to be consolidated, and you can’t just call the framework, even if it is very cool to write.
This article is reproduced from: https://zburu.com/archives/169.html
This site is for inclusion only, and the copyright belongs to the original author.