vue之获取dialog 中的组件ref对象

<template>
    <el-dialog
            ref ="dialog"
            custom-class="sigDialog"
            title="签章"
            :visible.sync="dialogVisible1"
            width="90%"
            :modal="false"
            :show-close="true"
            :close-on-click-modal="false"
            :before-close="handleClose1">

        <signature ref="seal1" :preData="preData" @saveSignData="saveSignData"></signature>

        <span slot="footer" class="dialog-footer">
            <el-button @click="handleClick(1)">取 消</el-button>
            <el-button type="primary" @click="handleClick(2)">保存</el-button>
        </span>
    </el-dialog>
</template>

一定要先打开dialog 否则是获取不到的

猜你喜欢

转载自blog.csdn.net/qq_34907249/article/details/127675001