element-ui中弹框dialog不显示,仅背景变灰

1.问题描述

根据element官网的对话框代码,使用时会发现弹框不显示,需要增加一个属性

:append-to-body="true"

在这里插入图片描述

2.加上之后效果

<template>
	<el-button type="text" size="mini" @click="copyPanel = true">复制</el-button>
		 <el-dialog
		    title="复制仪表板"
		    :visible.sync="copyPanel"
		    :append-to-body="true"
		    width="530px">
			  <el-form size="small" :model="formCopyPanel" ref="formCopyPanel" label-width="109px">
				 <el-form-item label="复制到">
					  <el-select v-model="formCopyPanel.position" placeholder="" style="width: 360px;">
						 <el-option label="仪表板" value="仪表板"></el-option>
						 <el-option label="来点原因分析" value="来点原因分析"></el-option>
					 </el-select>
				 </el-form-item>
			 </el-form>
		     <div slot="footer" class="dialog-footer">
				 <el-button @click="copyPanel = false">取 消</el-button>
				 <el-button type="primary" @click="copyPanel = false">确 定</el-button>
		     </div>
		</el-dialog>
</template>
发布了23 篇原创文章 · 获赞 0 · 访问量 2664

猜你喜欢

转载自blog.csdn.net/xy405580364/article/details/102899686
今日推荐