element-ui dialog弹出框内嵌显示问题

一层内嵌弹出框问题:
如下图:弹出框在页面下面在这里插入图片描述
修改前代码:

<template slot-scope="scope">
  <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
  <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
  <el-button type="text" size="small" @click="stationDetailHandle(scope.row.id)">站点详情</el-button>
  <el-dialog title="收货地址" :visible.sync="dialogTableVisible" >
    <el-table :data="gridData">
      <el-table-column property="date" label="日期" width="150"></el-table-column>
      <el-table-column property="name" label="姓名" width="200"></el-table-column>
      <el-table-column property="address" label="地址"></el-table-column>
    </el-table>
  </el-dialog>
</template>

解决办法:
在dialog中加属性 :modal-append-to-body=“false”

<el-dialog title="收货地址" :visible.sync="dialogTableVisible" :modal-append-to-body="false">
  <el-table :data="gridData">
    <el-table-column property="date" label="日期" width="150"></el-table-column>
    <el-table-column property="name" label="姓名" width="200"></el-table-column>
    <el-table-column property="address" label="地址"></el-table-column>
  </el-table>
</el-dialog>

两层dialog内嵌,就是在一个弹出框中再点击一个弹出框:
在这里插入图片描述
解决办法:
在第一个内嵌页面的el-dialog标签中添加 append-to-body属性,代码如下:

<el-dialog
  :title="!dataForm.id ? '新增' : '修改'"
  :close-on-click-modal="false"
  :visible.sync="visible" append-to-body>
  <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
  <el-form-item label="${column.comments}" prop="staionName">
    <el-input v-model="dataForm.staionName" placeholder="${column.comments}"></el-input>
  </el-form-item>
  <el-form-item label="${column.comments}" prop="stationTime">
    <el-input v-model="dataForm.stationTime" placeholder="${column.comments}"></el-input>
  </el-form-item>
  <el-form-item label="${column.comments}" prop="staionOrder">
    <el-input v-model="dataForm.staionOrder" placeholder="${column.comments}"></el-input>
  </el-form-item>
  <el-form-item label="${column.comments}" prop="busId">
    <el-input v-model="dataForm.busId" placeholder="${column.comments}"></el-input>
  </el-form-item>
  </el-form>
  <span slot="footer" class="dialog-footer">
    <el-button @click="visible = false">取消</el-button>
    <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
  </span>
</el-dialog>
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页