this.$ doesn't work with elements that are inside an if statement