The release of aveon V4, a simple and easy-to-use mvvm framework

Source: Internet
Author: User
ArticleDirectory
    • The main advantages are as follows:

Aveon has been extracted from the mass framework without any dependencies.

The main advantages are as follows:
    • Simple to use, add bindings in HTML, define viewmodel with avron. Define in JS, and then call the avron. scan method, it will work!
    • Compatible with IE6
    • No dependency, only 77 K, 22 K after compression
    • Supports MPs queue style filtering functions to facilitate formatting and output.
    • The granularity of partial Refresh has been refined to a text node, feature node
    • The node to be operated is bound to the view refresh function during the first scan and cached. Therefore, there is no room for the selector to appear.
    • Allow Dom operationsCodeAlmost extinct
    • The overlapping overwrite mechanism similar to CSS is used to make each viewmodel partition render the page alternately.
    • When a node is removed, the corresponding view refresh function is intelligently uninstalled to save memory.
    • All available accessors are used to notify the upper layers of the two-way binding chain in a timely and targeted manner (composite computed attribute, monitoring array, and evaluation function compiled based on bound values, view refresh function ).

Comparison with other frameworks

    • It is smaller in size, in the main several mvvm frameworks (having two-way binding mechanism), Knockout is more than three thousand lines, angularjs 16 thousand, tens of thousands of lines of emberjs2-3, winjs is several M, kendoui is several M!
    • Compatibility, kendoui and knockoutjs IE6, angularjs IE7, emberjs IE8, winjs ie9
    • Make the User write less code (see my Todos)
    • It is more difficult to get started than knockout, but it is easier to get started with angularjs.
    • Like knockoutjs, angular, and winjs, dynamic templates are used to ensure that the data on the first screen is authentic and Seo-friendly.
    • The source code is also the easiest to read. Simple code also means easy extension debugging.

The following describes how to implement a tabs using aveon.

 
<Div MS-controller = "tabs"> <Div MS-each-tab = "tabs" class = "triggers"> <a href = "###" class = "Trigger "Ms-class-selected =" activated = $ Index "MS-click =" Activate ">{{ tab. title }}</A> </div> <Div MS-each-tab = "tabs"> <Div class = "Panel" MS-visible = "activated ===$ index "> {tab. panel }}</div> </div>
 aveon. ready (function () {aveon. define ("tabs", function (a) {. tabs = [{Title: "aaaa", panel: "AAAA panel" },{ title: "BBBB", panel: "ffffffffffffffffff" },{ title: "CCCC ", panel: "CCCC panel"}]. activated = 0. activate = function () {. activated = This. $ scope. $ index ;}}) aveon. scan () ;}) 

{Tab. Title }{{ tab. Panel }}

For more examples and introductions, see here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.