使用Kotlin的聚合物3.0元件
有人能告诉我如何使用kotlin js创建Polymer 3.0元素吗 问题是Javascript中的聚合元素是使用Kotlin的聚合物3.0元件,kotlin,polymer,Kotlin,Polymer,有人能告诉我如何使用kotlin js创建Polymer 3.0元素吗 问题是Javascript中的聚合元素是 class AndyApp extends PolymerElement { static get template() { return html` <style include="shared-styles"> :host { display: block;
class AndyApp extends PolymerElement {
static get template() {
return html`
<style include="shared-styles">
:host {
display: block;
padding: 10px;
background-color: #0D334988;
}
</style>
<div class="card">
<div class="circle">1</div>
<h1>New View</h1>
<p>New view!</p>
</div>
`;
}
}
customElements.define("andy-app", AndyApp)
不知何故,编译后,我的fun template()
或val template
可以在和yapp.Companion.template()
或和yapp.Companion.template
中找到,如何将其编译为和yapp.template()
或和yapp.template
另一个问题是:kotlin js中等价的html ``模板文字是什么
class AndyApp : PolymerElement {
companion object {
fun getTemplate() {
. . .
}
//also tried
val template
get() {
. . .
}
}
}