Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save suzuki0keiichi/cf6a34cad496fe8365eb to your computer and use it in GitHub Desktop.
Save suzuki0keiichi/cf6a34cad496fe8365eb to your computer and use it in GitHub Desktop.
Scala.jsでfullOptJSすると良い感じにやってくれる件(Vueの宣言は別でしてある)
new Vue(VueInstantiationOptions(el = "#editor", template = "template"))
object VueInstantiationOptions {
def apply(data: js.Object = null, el: String = null, template: String = null) = {
val opt = js.Dynamic.literal()
if (data != null) {
opt.data = data
}
if (el != null) {
opt.el = el
}
if (template != null) {
opt.template = template
}
opt
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment