elementui的dialog弹窗关闭之后不会销毁怎么处理?

513 阅读1分钟

解决方法:在引用弹窗组件的地方加上v-if

父组件中引用

<customDialog v-if="isDialogShow" :visible.sync="isDialogShow" :currentIndex="0" />

子组件customDialog

 <el-dialog :title="dialogTitle" :visible.sync="show" @close="$emit('update:visible', false)">

            <template v-if="currentStep == 0">
            </template>

            <!-- 步骤二 -->
            <template v-else-if="currentStep == 1">
            </template>

            <!-- 步骤三 -->
            <template v-else-if="currentStep == 2">
            </template>

</el-dialog>