闵超

vuePress-theme-reco 闵超    2015 - 2024
闵超 闵超

模式切换

  • 夜间模式
  • 白天模式
首页
博客
  • 前端
  • 生活
  • android
  • 后端
标签
时间
文档
  • mcf-cli
  • mc-ui
旧版博客
联系 or 支持
连接
  • 掘金
  • GitHub
author-avatar

闵超

21

文章

14

标签

首页
博客
  • 前端
  • 生活
  • android
  • 后端
标签
时间
文档
  • mcf-cli
  • mc-ui
旧版博客
联系 or 支持
连接
  • 掘金
  • GitHub
  • 介绍 Introduction

    • 介绍 introduce
    • 更新日志 Update
  • 使用安装 Install

    • 使用指南 Useage
  • 基础组件 Basic

    • 色彩 Color
    • 布局 Layout
    • 字体图标 Icons
    • 按钮 Btn
  • 表单组件 Form

    • 输入框 Input
    • 单选框 Radio
    • 复选框 Checkbox
  • 其他组件 Other

    • 弹框 Dialog

弹框 Dialog

vuePress-theme-reco 闵超    2015 - 2024

弹框 Dialog

闵超 2020-12-30

# Dialog 弹框

通过按钮或事件触发

# 基础用法

dialog弹框

这是一个标题

这是内容部分
取消 确认
<template>
    <div>
        <div class="box">
            <mc-btn type="primary" @click="dislogChange">dialog弹框</mc-btn>
        </div>
        <mc-dialog
            title="这是一个弹窗"
            :visible="showDialog"
            width="60%"
            @close="showDialog = false"
        >
            <template v-slot:title>
            <h3>这是一个标题</h3>
            </template>
            <div>这是内容部分</div>
            <template v-slot:footer>
            <mc-btn @click="showDialog = false" plain type="none"
                >取消</mc-btn
            >
            <mc-btn plain type="primary" @click="showDialog = false" >确认</mc-btn>
            </template>
        </mc-dialog>
      </div>
</template>
<script>
export default {
  data() {
    return {
      showDialog: false
    }
  },
  methods: {
    dislogChange() {
      this.showDialog = true;
    }
  }
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
显示代码 复制代码 复制代码

# Attributes

参数 说明 类型 默认值 可选值
visible 弹框可视 Boolean false -
title 标题 String "提示" -
width 宽度 String 50% -
top 距离顶部 String 15vh -
handleClose 传入的关闭方法 Function - -