Many of the functions of jquery can be handled through the binding properties of Avalon, such as the click Method corresponding to the Ms-click,css method corresponding to the Ms-css,toggle method corresponding to the ms-visible, its data caching function Avalon also moved over. But unlike jquery, Avalon is the data-☆ attribute that saves data directly to the element node's HTML5. When you restore data from the Data-☆ property, it will simply convert the data back to you.
In Ms-data bindings, consider that if you convert an object to a string and then restore it, you lose the function or something, so they are saved directly above the element.
<! DOCTYPE html>This is a very simple binding, nothing to say, just remember that objects and arrays are stored directly on the element node on the line. The following is its source code:
"Data": Function (val, elem, data) { var key = "data-" + Data.param if (val && typeof val = = = "Object") {
elem[key] = val } else { elem.setattribute (key, String (val)) }},
Mini MVVM Framework Avalonjs Learning Tutorial 7, data caching