【发布时间】:2015-08-27 15:23:06
【问题描述】:
我正在尝试将 Raphael 与 enyo.js 集成以使用 Raphael 而不是通过 enyo 创建 SVG 组件,因此我可以使用一些 Raphael 功能。我想用它的子组件svg替换默认呈现的div,我在jsfiddle下面创建。谁能帮我修一下?
http://jsfiddle.net/stackit/uzjafamo/8/
代码
enyo.kind({
name: "Board",
kind: "enyo.Control",
paper: null,
create: function(){
this.inherited(arguments);
},
rendered: function(){
this.inherited(arguments);
if(this.hasNode()){
paper = Raphael(this.hasNode().id, 100, 100);
}
}
})
enyo.kind({
name: "pages",
kind: "enyo.Control",
create: function(){
this.inherited(arguments);
this.loadView();
},
loadView: function(){
if(!this.$.board){
var com = this.createComponent({
name: "board",
kind: "Board",
},{
owner: this
});
com.render();
}
}
});
new pages().renderInto(document.getElementById("cans"));
【问题讨论】:
标签: javascript svg raphael enyo