My mvvm framework V3 tutorial -- set Processing

Source: Internet
Author: User

One concept of aveon is that the operation data is the operation Dom. This is the most obvious result in collection processing.

A series of methods related to each binding and set accessors.

<P Data-each-method = "methods"> <span data-TEXT = "method"> </span>, </P> <HR/> <ul data-each-El = "list"> <li> <span data-TEXT = "El. title "> </span> <button type =" button "data-on-click =" Remove "> remove </button> </LI> </ul>
Require ("aveon, ready", function ($) {var $ = $. mvvm var VM =$ $. toviewmodel ({Methods: ["push", "unshift", "sort", "reverse", "shift", "pop", "splice", "Remove ", "removeat", "erase", "clear"], list: [{Title: "AAA" },{ title: "BBB" },{ title: "CCC "}, {Title: "DDD"}]}); VM. remove = function (e) {VM. list. erase (E & e.tar get)} $. render (VM) setTimeout (function () {VM. list. push ({Title: "push"}) }, 1000) setTimeout (function () {VM. list. unshift ({Title: "unshift"}) }, 1500) setTimeout (function () {VM. list. splice (1111, {Title: "2222" },{ title: "3333" },{ title: "2000"}) },) setTimeout (function () {VM. list. reverse ()}, 2500 )})



  • Remove

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: 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.