liuyueyi/quick-media

svg插件模板替换功能无法修改image标签的href属性

Closed this issue · 0 comments

Describe the bug(BUG描述)
3.0版本svg插件模板替换功能无法修改image标签的href属性,3.0.1版本之后没有进行测试,具体表现不明。若3.0.1之后的版本与3.0版本使用同一模板替换处理方法,理论上来说存在同样的问题。
To Reproduce(复现)

您使用的姿势,与复现用例:
直接使用xlink:href作为属性名无法实现替换
bug表现形式:

bug产生原因(若您已发现具体的bug产生原因,请直接贴上,也可以提merge进行修复)
setAttribute方法无法正常的对xlink开关的属性进行设置,应该使用setAttributeNS方法进行属性设置,使用http://w3.org.1999/xlink作为方法的namespaceURI使用href作为属性名进行替换。这里有对这个问题进行过讨论

    dom.setAttributeNS("http://w3.org/1999/xlink", "href", "content");

Expected behavior(预期正常的效果)

A clear and concise description of what you expected to happen.

Screenshots(截图)
If applicable, add screenshots to help explain your problem.