部分属性(svg中的xlink:href, foreignObject等)的namespace未处理
Opened this issue · 2 comments
hellozts4120 commented
在项目实践中发现由于regular没有处理部分属性,如svg中的image元素的xlink:href属性,及foreignObject元素的namespace,导致当regular模板中存在这些属性时,数据不能成功绑定,希望能解决这个bug!
rainfore commented
我就说怎么用不了xlink:href
leeluolee commented
@rainfore 先这样
Regular.directive('xlink:href', function (elem, value) {
if (value.type === 'expression') {
this.$watch(value, function (val) {
elem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', val);
})
} else {
elem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', value);
}
});
模板不用改