弹出框

vue3代码
<template>
  <el-button type="default" @click="model = true">打开弹出框</el-button>
  <vol-box
    :lazy="true"
    v-model="model"
    title="弹出框"
    :width="700"
    :padding="5"
    :onModelClose="onModelClose"
  >
    <div style="height:300px">弹出框内容</div>
    <template #footer><el-button type="default" size="small" icon="Close" @click="closeModel">关闭</el-button> </template>
  </vol-box>
</template>
<script setup>
import { ref, reactive, getCurrentInstance } from 'vue'
const { proxy } = getCurrentInstance()
const model = ref(false)
const onModelClose = () => {
  proxy.$message.success('弹出框右上角点击x关闭事件')
}
const closeModel = () => {
  model.value = false
}
Last Updated 2025/3/31 18:57:52
ON THIS PAGE