-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't access element client side via this.$refs #50
Comments
When on the client, there is a one export default {
mounted() {
// this.$refs.inputRef doesn't exist yet
this.$nextTick(() => {
// But now it does
this.$refs.inputRef.value = 'foo'
})
}
} |
@tmorehouse @tettoffensive Solution 1: wait 2 ticks mounted() {
this.$nextTick(() => {
this.$nextTick(() => {
this.$refs.mainGallery.swiper.controller.control = this.$refs.thumbGallery.swiper
this.$refs.thumbGallery.swiper.controller.control = this.$refs.mainGallery.swiper
})
})
} Solution 2: parent component // parent
<template>
<client-only>
<Child v-bind="$attrs"/>
</client-only>
</template>
// child
<template>
<stuff-here/>
</template>
<script>
export default {
mounted() {
this.$refs.mainGallery.swiper.controller.control = this.$refs.thumbGallery.swiper
this.$refs.thumbGallery.swiper.controller.control = this.$refs.mainGallery.swiper
}
}
</script> |
I'm using the
client-only
that Nuxt imports. I have a component that only works client sidevue-bootstrap-typeahead
so I've wrapped it inclient-only
and filled the placeholder slot with a normalinput
. Problem is I was settingthis.$refs.inputRef.value = value
on the client side but thethis.$refs
doesn't includeinputRef
.inputPlaceholderRef
does show up, however.Is there a way in which this could work? In the meantime, maybe there is a work around?
The text was updated successfully, but these errors were encountered: