Hello everyone, I have previously created the JS template wheel Otmpl. Although it is barely good, it is terrible compared with the simplicity and elegance of MVC Razor. After a few days of research, I finally presented the first version After referring to the code of some cool people outside China. You are welcome to make a discussion.
Supported Razor features
- If-else judgment.
- Do-while loop.
- While loop.
- For loop.
- Helper method.
- '* Comment *'.
Sample Code 1 (to be used in MVC, I use the "'" symbol under the Esc key to replace "@". The JS-based micro Razor engine '(">" + index) user number is 1' model. message 'model. dateView Code download [click here to download] This version is not very mature and the Code is not obfuscated. If you do not like "'", you can modify scripts/Razor. base. configure "razorAnchor" in js. I will not introduce much about Razor syntax. If you have better optimization suggestions, please leave a message! If you like this article, please refer ~