上一页 1 ··· 168 169 170 171 172 173 174 175 176 ··· 494 下一页
摘要: The part pseudo class allows consumers of a web component to manipulate certain key elements inside the Shadow DOM. In this lesson we will explore two 阅读全文
posted @ 2020-10-29 22:04 Zhentiw 阅读(125) 评论(0) 推荐(0)
摘要: document.getElementById("app").innerHTML = ` <h1>Hello Parcel!</h1> <div> <button id="plus">+</button> <button id="mius">-</button> </div> `; const ad 阅读全文
posted @ 2020-10-29 01:34 Zhentiw 阅读(131) 评论(0) 推荐(0)
摘要: (0..9).forEach(::println) (9 downTo 0).forEach(::println) (0 until 9).forEach(::println) // 0 to 8 (0..9 step 2).forEach(::println) ('A'..'F').forEach 阅读全文
posted @ 2020-10-29 01:04 Zhentiw 阅读(86) 评论(0) 推荐(0)
摘要: fun getColorType() : String { val color = getUpperFavoriteColor() return when (color) { "" -> "empty" "RED", "GREEN", "BLUE" -> "rgb" else -> "other" 阅读全文
posted @ 2020-10-28 20:58 Zhentiw 阅读(128) 评论(0) 推荐(0)
摘要: Let function is another way to solve null problem in kotlin. When you have such problem: var favoriteColor: String? = null...... return if f(avoriteCo 阅读全文
posted @ 2020-10-28 20:54 Zhentiw 阅读(64) 评论(0) 推荐(0)
摘要: In Javascript, we have: return age null ? -1 : age In kotlin, we can do the same thing with a better / simpler syntax: val safeAge: Int get() = age ?: 阅读全文
posted @ 2020-10-28 20:37 Zhentiw 阅读(126) 评论(0) 推荐(0)
摘要: For data class, you can get 'copy' method, and also destructing: data class Customer (val name: String, val address: String, var age: Int) { // if we 阅读全文
posted @ 2020-10-27 17:04 Zhentiw 阅读(93) 评论(0) 推荐(0)
摘要: // Shorter version class AnotherAlternativeCustomer (val name: String,var age: Int, val address: String = "") { var approvered: Boolean = false set(va 阅读全文
posted @ 2020-10-27 16:49 Zhentiw 阅读(115) 评论(0) 推荐(0)
摘要: package com.rsk class Customer (val name: String, val address: String, var age: Int) { // if we don't want to pass in the address constructor(name: St 阅读全文
posted @ 2020-10-27 16:42 Zhentiw 阅读(133) 评论(0) 推荐(0)
摘要: In this lesson, we use CSS transforms to create configurable 3D cuboids. Using CSS transforms in combination with scoped CSS variables, we are able to 阅读全文
posted @ 2020-10-26 21:37 Zhentiw 阅读(183) 评论(0) 推荐(0)
上一页 1 ··· 168 169 170 171 172 173 174 175 176 ··· 494 下一页