Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Kotlin的聚合物3.0元件_Kotlin_Polymer - Fatal编程技术网

使用Kotlin的聚合物3.0元件

使用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;

有人能告诉我如何使用kotlin js创建Polymer 3.0元素吗

问题是Javascript中的聚合元素是

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() {
           . . .
        }
    }
}