Vue.js 如何在vuejs中更新$refs

Vue.js 如何在vuejs中更新$refs,vue.js,dynamic,vue-component,ref,Vue.js,Dynamic,Vue Component,Ref,变量更新后,如何在Vuejs中更新$refs 当我更新this.wordList时,我在this.refs.words中得到了旧单词 {{word.text} 我尝试添加v-if,并像这样重新创建组件: reset(){ this.showList=false; this.showList=true; } 但这并没有帮助,这个答案也是如此 我知道裁判不是实时的,但我需要它来把每个单词排在第一位 this.wordRef[this.wordCount].getBoundingClientRe

变量更新后,如何在Vuejs中更新
$refs

当我更新
this.wordList
时,我在
this.refs.words中得到了旧单词


{{word.text}
我尝试添加
v-if
,并像这样重新创建组件:

reset(){
this.showList=false;
this.showList=true;
}
但这并没有帮助,这个答案也是如此

我知道裁判不是实时的,但我需要它来把每个单词排在第一位

this.wordRef[this.wordCount].getBoundingClientRect().top;

你能在codepen或codesandbox中重新创建这个问题吗?我会尝试将它上传到git