【发布时间】:2016-01-07 21:59:36
【问题描述】:
如何在<test-fixture> 中使用<template is="dom-bind"> 和web-components-tester?
我尝试使用 Polymer 0.8 x-template 方式:
<test-fixture id="dom-bind-fixture">
<template is="dom-bind">
<h1>{{greeting}}</h2>
</template>
</test-fixture>
<script>
// ...
var bound = fixture('dom-bind-fixture', {greeting: 'ohai thurr'});
</script>
这自然会失败,因为dom-bind 没有stamp 方法。
然后,我尝试将其从原生 <template> 元素中剔除:
<test-fixture id="dom-bind-fixture">
<template>
<h1>outside dom-bind</h1>
<template is="dom-bind">
<h2>inside dom-bind</h2>
</template>
</template>
</test-fixture>
但在非 Chrome 浏览器中,此标签仅标记 outside dom-bind。
有没有办法让它工作,或者它只是 web-components-tester/test-fixture/dom-bind 中的一个阻塞错误?
【问题讨论】:
-
作为参考,@tomalec 创建了一个GitHub issue 来跟踪这个。
标签: polymer web-component web-component-tester