element does something before closing the pop-up window

I wrote a small method, but unfortunately it is useless and needs to be deleted. I will record it.

html part:

   <!-- 科目阶段弹窗 -->
    <el-dialog 
    :visible.sync="dialogShowTree" 
    :title="title"  
    width="40%"  
    :before-close="onBeforeClose"		//关闭前的回调,会暂停 Dialog 的关闭
    >          
        <el-tree
            ref="tree"
            :data="subjectOptions"
            show-checkbox
            node-key="click"
            :default-expand-all =true
            @check="(click, checked)=>{handleCheckChange(click, checked)}"
            :props="defaultProps">
        </el-tree>
        <div class="footerCenter">
            <el-button type="primary" @click="treeSubmit()">确认</el-button>
            <el-button @click="treeLast()">取消</el-button>
        </div>
    </el-dialog>

js part:

       //关闭科目阶段弹窗前
       onBeforeClose(done){
    
    
           //...
           return done();//function(done),done 用于关闭 Dialog
       },

Guess you like

Origin blog.csdn.net/duruo0/article/details/120949751