2020-08-27 elementUI Dialog对话框使用

2020-08-27  本文已影响0人  jinya2437

问题点:elementUI Dialog对话框引用组件refs报错undefined

解决办法

追加open函数,并且在open函数里面使用this.$nextTick钩子函数,具体看代码

<template>
  <el-dialog title="编辑考点" :visible.sync="dialogVisible" width="100%" @open="initFn">
    <tagComponent ref="tagComp" @successNoticeEvent="successFn" @errorNoticeEvent="errorFn"></tagComponent>
  </el-dialog>
</template>
initFn(questionId) {
    this.$nextTick(()=>{
      this.$refs.tagComp.initData(questionId)
  })
}
上一篇 下一篇

猜你喜欢

热点阅读