Code Monkey home page Code Monkey logo

Comments (3)

RubyLouvre avatar RubyLouvre commented on June 8, 2024

初始化回调 改造不太成功,在ms-duplex, ms-include还是存在异步渲染的情况,不是全同步的

from avalon.

limodou avatar limodou commented on June 8, 2024

目前我遇到的是第一次初始化的时候,而且也没有用到上面的标签。

from avalon.

RubyLouvre avatar RubyLouvre commented on June 8, 2024
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
        <title>scope</title>
        <script src="avalon.js" type="text/javascript"></script>
        <script>

            avalon.ready(function() {
                var a = avalon.define("simple", function(vm) {
                    vm.firstName = "司徒"
                    vm.lastName = "正美"
                    vm.array = ["aaa", "bbb", "ccc"]
                    vm.argsClick = function(e, a, b) {
                        alert(a+ "  "+b)
                    }
                    vm.loopClick = function(a) {
                        alert(a)
                    }
                });
                avalon.scan();
            })

        </script>
    </head>
    <body>
        <fieldset ms-controller="simple">
            <legend>例子</legend>
            <div ms-click="argsClick($event, 100, firstName)">ssssssssssssssssssssss</div>
            <div ms-each-el="array" >
                <p ms-click="loopClick(el)">{{el}}</p>
            </div>
        </fieldset>
    </body>
</html>

实现对事件回调传参的支持,其中$event代表事件回调,this总是指向元素本身
大家看有没有BUG
https://github.com/RubyLouvre/avalon/blob/master/index22.html
暂时只改动了avalon.js这个文件,并没有处理avalon.mobile.js

from avalon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.