問題點(diǎn):elementUI Dialog對(duì)話框引用組件refs報(bào)錯(cuò)undefined
解決辦法
追加open函數(shù)滑臊,并且在open函數(shù)里面使用this.$nextTick鉤子函數(shù)物赶,具體看代碼
<template>
<el-dialog title="編輯考點(diǎn)" :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)
})
}