Closed shashi closed 6 years ago
I see Vue.component("vue-slider", VueSlider)
is required to be run before Vue instance is created but after vue has been loaded... I thought of wrapping the vue widget with another widget which sets up the component but then you'd have to have it forward all the observables as well... So I think it's easiest to bring this one back!
Oh wait, there's a beforeCreate
lifecycle handler :D
@JobJob solved the hooking in issue by delaying creating the vue instance till the next event loop tick!
Now this WORKS! --
using Vue
function slider(rng)
w = vue(dom"div"(
dom"vue-slider[ref=slider, v-model=value]"()
), ["value" => Observable{Any}(first(rng))]
)
on(identity, w["value"])
import!(w, "https://nightcatsama.github.io/vue-slider-component/dist/index.js")
onimport(w, @js function (Vue, vueSlider)
Vue.component("vue-slider", vueSlider)
end)
w
end
in an attempt to get this to work, I have removed the mention of
show_cb
thing.I removed some of the explicit SystemJS code, and the callback and dependencies kwargs, as it turns out you can now add them after the
Widget
object has been created (but before it gets rendered). Thanks tovue
now returning the widget object!Demo: