相关疑难解决方法(0)

删除由角度组件创建的主机HTML元素选择器

在角度2中,svg-rect是一个创建rect的组件,如下所示,

<svg height="550" width="450" x="0" y="0">
    <g id="svgGroup">
        <svg-rect>
        <!--template bindings={}-->
            <rect x="10" y="10" height="100" width="100" fill="red" stroke="#000" stroke-width="2"></rect>
        <!--template bindings={}-->
        </svg-rect>
        <svg-rect>
        <!--template bindings={}-->
            <rect x="10" y="10" height="100" width="100" fill="red" stroke="#000" stroke-width="2"></rect>
        <!--template bindings={}-->
        </svg-rect>
    </g>
</svg>
Run Code Online (Sandbox Code Playgroud)

但由于创建了特殊元素标签,因此不会呈现rect.如果删除了svg-rect标签,则会呈现rect

<svg height="550" width="450" x="0" y="0">
    <g id="svgGroup">
        <!--template bindings={}-->
        <rect x="10" y="10" height="100" width="100" fill="red" stroke="#000" stroke-width="2"></rect>
        <!--template bindings={}-->
        <!--template bindings={}-->
        <rect x="10" y="10" height="100" width="100" fill="red" stroke="#000" stroke-width="2"></rect>
        <!--template bindings={}-->
    </g> …
Run Code Online (Sandbox Code Playgroud)

svg angular

41
推荐指数
5
解决办法
2万
查看次数

标签 统计

angular ×1

svg ×1