This article mainly introduces the practical example of JsRender, including knowledge points such as tagelse usage and cyclically nested access to parent-level data, and provides complete instance download, which is of great practical value, for more information about how to use tag else and cyclically nested access to parent-level data, see this document. Share it with you for your reference. The details are as follows:
Preface
JsRender is a jQuery-based JavaScript template engine with the following features:
· Simple and intuitive
· Powerful functions
· Scalable
· Lightning fast
These features seem very powerful, but almost every template engine will do so...
This template engine is available only when you need to work. After using it for a while, I found that it is indeed quite powerful. However, it is hard to understand that it is too powerful in some places.
On the other hand, JsRender's official documents are relatively detailed, but there are surprisingly few other materials. If you encounter any problems, you cannot find them. Not only are you unable to find relevant questions, but there are almost no results.
In addition, JsRender is hard to understand in some places, so we urgently need to share some "best practices ".
Based on the recent usage, I have summarized some practical experiences. Of course, these experiences cannot be found in official documents.
Nested loop use # parent access to parent-level data (not recommended)
The Code is as follows:
Use nested loops # Use parent to access parent data --- by Yang Yuan
Serial number |
Name |
Family Members |