我有一个类似这样的小Vue应用程序:
<div id="app">
<div class="row">
<div>
<statistic
class-name="stat-1"
:amount="amount"
:postfix="postfix"
:prefix="prefix"
:scale="scale"
:accuracy="accuracy"></statistic>
</div>
<div><!-- controls --></div>
</div>
</div>
JS:
Vue.component('statistic', {
props: ['amount', 'postfix','scale', 'className', 'accuracy', 'prefix','fill'],
/* config here */
template:`<div class="animated-statistic" :class="className">
<svg class="animated-statistic--graphic" width="200" height="200" viewBox="0 0 200 200">
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:rgb(249,232,154);stop-opacity:1" />
<stop offset="100%" style="stop-color:rgb(229,107,233);stop-opacity:1" />
</linearGradient>
</defs>
<circle cx="100" cy="100" :r="radius" fill="url(#grad1)"></circle>
</svg>
<div class="animated-statistic--text" v-text="value"></div>
</div>`
});
这很有效
link to working Codepen
但是,如果在ie11中遵循相同的链接,那么组件应该在一个空白区域中。除非我不正确地使用IE,否则我在控制台上看不到任何错误。
起初我以为这可能是IE中SVG的问题,但是我
another copy of the pen
使用静态svg,它正在呈现。
如果你检查IE11中的元素,你只会看到
<statistic></statistic>
标记-它们不会被呈现。
我是不是在用这个组件不支持的东西?