-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
Version
2.4.2
Reproduction link
No reproduction link, need hot reload...
Steps to reproduce
Use this vue file:
<template>
<div>
<div ref="test"></div>
</div>
</template>
<script>
export default {
name: 'test',
mounted () {
setInterval(() => {
console.log(this.$refs.test)
}, 2000)
}
}
</script>
<style>
</style>
Run it then edit the file, change this.$refs.test
to this.$refs.test.clientWidth
, save and watch the console.
What is expected?
After hot reload, display the width of the div
.
What is actually happening?
After hot reload, return undefined
, then the width of the div
.
It the same if you use a $refs
in a function of an event listener. Even if you destroy it in deforeDestroy
.
jloewe and vinnitu
Metadata
Metadata
Assignees
Labels
No labels