I've encountered a peculiar issue. I'm trying to access certain elements within the created() hook, but I seem to be running into some trouble specifically with the refs object:
created() {
console.log(this.$refs)
}
// output:
{
bar: div.red.bar
content: div.name-description
description: p.description.dark
redContainer: div.red.red-container
sections: div.sections
title: h1.name.dark
__proto__: Object
}
Oddly enough, when I attempt to target a specific element, it returns undefined:
created() {
console.log(this.$refs.content)
}
//output
undefined
Can anyone shed some light on why this is happening? I'm facing similar issues when trying to retrieve width/height information from elements in computed properties... (e.g. this.$refs.content.clientWidth)