Git Product home page Git Product logo

Comments (3)

RubyLouvre avatar RubyLouvre commented on July 16, 2024

script 标签都会被pass掉啊,我这里运行得好好的

    var stopScan = avalon.oneObject("area,base,basefont,br,col,hr,img,input,link,meta,param,embed,wbr,script,style,textarea")
   scanAttr(elem, vmodels) //扫描特性节点
        if (!stopScan[elem.tagName] && rbind.test(elem.innerHTML)) {
            scanNodes(elem, vmodels)
        }

这是源码

<!DOCTYPE HTML>
<html id="html">
    <head>
        <meta charset="utf-8">
        <title>测试用例-yuewang</title>
        <style>
       
        </style>
    </head>
    <body>
        <script src="avalon.js"></script>
        <script>
            avalon.define("test", function(vm) {
                vm.array = [{value: "aaa", text: "111"}, {value: "bbb", text: "222"}, {value: "bbb", text: "333"}]
            })
            var model = avalon.define("index", function(vm) {
                vm.message = "XXXX";
            });
        </script>
        <div ms-controller="test">
            <select ms-each-el="array">
                <option ms-value="el.value">{{$index}}、{{el.value}}</option>
            </select>
        </div>
        <script type="text/avalon" id="index">
            <div ms-controller="index">
            <h2>{{message}}</h2>
            <input ms-model="message">
            </div>
        </script>
        <div  ms-include="'index'"></div>
    </body>
</html>

from avalon.

Gaubee avatar Gaubee commented on July 16, 2024

@RubyLouvre sory,这代码运行起来还是有问题,
看截图,h2标签出现的是message,而不是XXXX
ms-include

from avalon.

RubyLouvre avatar RubyLouvre commented on July 16, 2024

发现问题了

        if (!stopScan[elem.tagName] && rbind.test(elem.innerHTML)) {
            scanNodes(elem, vmodels)
        }

应改成

        if (!stopScan[elem.tagName.toLowerCase()] && rbind.test(elem.innerHTML)) {
            scanNodes(elem, vmodels)
        }

THX !

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.