Answer the question
In order to leave comments, you need to log in
How to use this.$refs in typescript?
Hello, I have a method like
methods: {
deploy() {
if (window.scrollY > this.$refs.nav.offsetHeight) {
this.isDeployed = false;
}
(property) $refs: Data
Object is of type 'unknown'.Vetur(2571)
Answer the question
In order to leave comments, you need to log in
class YourComponent extends Vue {
$refs!: {
checkboxElement: HTMLFormElement
}
someMethod () {
this.$refs.checkboxElement.checked
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question