Comments (3)
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.
@RubyLouvre sory,这代码运行起来还是有问题,
看截图,h2标签出现的是message,而不是XXXX
from avalon.
发现问题了
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avalon.