SVG clipPath与HTML基本元素AngularJS应用 [英] Svg clipPath in AngularJS app with HTML Base Element

查看:146
本文介绍了SVG clipPath与HTML基本元素AngularJS应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SVG clipPath 在我的AngularJS项目。我有指定相对URL的clipPath一个问题,因为我需要使用<基地方式> 在我的项目元素

I use svg clipPath in my AngularJS project. I have a problem with specifying a relative url to the clipPath because i need to use the <base> element in my project.

例如这个code项目中的作品,未经,但不是在同一个项目&LT;基本href =/ &GT;

For example this code works in a project without base, but not in a project with <base href="/">

<svg width="120" height="120"
     viewPort="0 0 120 120" version="1.1"
     xmlns="http://www.w3.org/2000/svg">

    <defs>
        <clipPath id="myClip">
            <rect x="10" y="10" width="60" height="60"></rect>
        </clipPath>
    </defs>

    <g clip-path="url(#myClip)">
        <circle cx="30" cy="30" r="20"/>
        <circle cx="70" cy="70" r="20"/>
    </g>

</svg>

这又如何解决呢?我使用的UI路由器,如果是相关的问题...

How can this be solved? I use ui-router, if that is relevant to the question...

This问题是差不多的,但解决方案的OP发现删除的基地,是不是在我的情况的解决方案。

This question is about the same, but the "solution" the OP found was to remove the base which isn't a solution in my case.

推荐答案

修改

<g clip-path="url(#myClip)">

让您使用的是绝对URL +片段标识符,而不仅仅是一个片段标识符自身。例如。网址( http://mydomain.com/mypage#myClip

您可能能够例如移除某些部分HTTP和如果基本标记匹配的绝对URL,以便/我的空间#myClip可能的工作领域。

You may be able to remove some parts e.g. the http and the domain if the base tag matches the absolute URL so /mypage#myClip might work.

这篇关于SVG clipPath与HTML基本元素AngularJS应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆