嵌套谈话框,不显示第二层?

<el-table-column label="姓名" prop="username">
          <template slot-scope="scope">
            <el-button type="text" v-model="scope.row.username" @click="showEmbedDialogVisible(scope.row.id)">{{
              scope.row.username }}</el-button>
          </template>
        </el-table-column>
 <el-dialog title="用户信息" :visible.sync="outerDialogTableVisible">
        <el-table :data="userList">
          <el-table-column prop="username" label="姓名" width="150"></el-table-column>
          <el-table-column prop="email" label="邮箱" width="200"></el-table-column>
          <el-table-column prop="mobile" label="手机"></el-table-column>
        </el-table>
        <el-dialog :visible.sync="innerVisible" title="内层 Dialog" append-to-body>
          <el-table :data="userList">
            <el-table-column property="username" label="姓名" width="150"></el-table-column>
            <el-table-column property="email" label="邮箱" width="200"></el-table-column>
            <el-table-column property="mobile" label="手机"></el-table-column>
          </el-table>
        </el-dialog>
        <span slot="footer" class="dialog-footer">
          <el-button @click="editDialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="innerVisible">展示第二层</el-button>
        </span>
      </el-dialog>
async showEmbedDialogVisible (id) {
      const { data: res } = await this.$http.get(`users/${id}`)
      if (res.meta.status !== 200) return this.$message.error('根据ID查询用户失败!')
      this.$message.success('根据用户ID查询身份信息成功!')
      this.editForm = res.data
      this.outerDialogTableVisible = true
      this.innerVisible = true
    }
阅读 1.7k
2 个回答

测试了下可以显示,不过首次显示层级关系有问题,inner会被盖在下面,你可以看下是不是层级关系的问题

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题