add browser-example-with-library maven project (kotlin->javascript)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package sample
|
||||
|
||||
import kotlin.Pair
|
||||
import kotlin.browser.document
|
||||
import library.sample.*
|
||||
|
||||
fun myApp() {
|
||||
val element = document.getElementById("foo")
|
||||
if (element != null) {
|
||||
val p = Pair(10, 20)
|
||||
val x = pairAdd(p)
|
||||
val y = pairMul(p)
|
||||
val z = IntHolder(100).value
|
||||
element.appendChild(document.createTextNode("x=$x y=$y z=$z")!!)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user