# 弹窗 - Dialog

# 示例

弹出对话框

# 代码

点击查看源码
<template>
  <div class="container">
    <van-button @click="dialogVisible=true">弹出对话框</van-button>
    <van-dialog :visible.sync="dialogVisible">
      <template v-slot:title></template>
      <span>这是弹出内容</span>
      <template v-slot:footer>
        <van-button plain type="primary" @click="dialogVisible=false">取消</van-button>
        <van-button plain type="primary" @click="dialogVisible = false">确定</van-button>
      </template>
    </van-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
    };
  },
};
</script>
<style>
</style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24