首页 > 解决方案 > 当我在 javascript 中使用 setAttributeNS 时,使用“”替换“”

问题描述

我需要用 javascript 添加这个属性和这个值:

routerLink='/panel/country/add'

但是当我在javascript中设置属性时:

    let Link: string = "routerLink";
    tailDiv.setAttributeNS(null, Link, this.subItems[i].route)

它使用“”但我需要''"/panel/country/add"但我需要这个'/panel/country/add'

我怎样才能做到这一点?

标签: javascript

解决方案


推荐阅读