我有这种控制用于加载SVG文档(工程,SVG显示细腻)处理与SVG控制事件在Enyo 2.0(对象或嵌入标签)
enyo.kind({
name: "SvgParser",
kind:"Control",
fit: true,
published: {
source:''
},
components:[{
tag: "object", // Or Embed
name:'svgObject',
classes: 'SvgObject',
ontap:'click',
onload:'loaded'
}],
create: function() {
this.inherited(arguments);
this.sourceChanged();
},
click: function(inSender, inEvent) {
console.log('click'); // doesn't happen
},
sourceChanged: function() {
this.$.svgObject.attributes.type = 'image/svg+xml';
this.$.svgObject.attributes.data = this.source;
},
loaded: function(inSender, inEvent) {
console.log('loaded'); // doesn't happen
}
});
但事件处理程序“抽头'和'负载'从未被触发,有人可以解释我做错了什么吗?在此先感谢
完美答案!谢谢 –