Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.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
使用Kotlinx在Ktor中将onClick添加到按钮_Kotlin_Freemarker_Ktor_Kotlinx - Fatal编程技术网

使用Kotlinx在Ktor中将onClick添加到按钮

使用Kotlinx在Ktor中将onClick添加到按钮,kotlin,freemarker,ktor,kotlinx,Kotlin,Freemarker,Ktor,Kotlinx,我目前正在试用Ktor。但它已经无法将onClickListener注册到按钮 我只是想知道,因为onClick是从String扩展而来的。如果我点击onClick,我得到的代码是: var CommonAttributeGroupFacade.onClick : String get() = attributeStringString.get(this, "onclick") set(newValue) {attributeStringString.set(this, "on

我目前正在试用Ktor。但它已经无法将onClickListener注册到按钮

我只是想知道,因为onClick是从String扩展而来的。如果我点击onClick,我得到的代码是:

var CommonAttributeGroupFacade.onClick : String
    get()  = attributeStringString.get(this, "onclick")
    set(newValue) {attributeStringString.set(this, "onclick", newValue)}
所以我认为onClick有一个能手和二传手,但没有更多。我安装了location和FreeMarker,因此这是我的路线:

get<CharityRoute> {
            val id = it.id
            call.respondHtml {
                body {
                    h1 { +"${it.id}" }
                    ul {
                        for (n in it.list) {
                            li { +"$n" }
                        }
                    }
                    button {
                        text("Run function")
                        onClick = "Hello"
                    }
                }
            }
        }
get{
val id=it.id
call.respondHtml{
身体{
h1{+“${it.id}”
保险商实验室{
for(it.list中的n){
li{+“$n”}
}
}
钮扣{
文本(“运行函数”)
onClick=“你好”
}
}
}
}
也许有人对Ktor有更多的经验,尤其是对Kotlinx