File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ declare module 'vue' {
2222 ElTag : typeof import ( 'element-plus/es' ) [ 'ElTag' ]
2323 HelloWorld : typeof import ( './components/HelloWorld.vue' ) [ 'default' ]
2424 Logos : typeof import ( './components/Logos.vue' ) [ 'default' ]
25+ MessageBoxDemo : typeof import ( './components/MessageBoxDemo.vue' ) [ 'default' ]
2526 RouterLink : typeof import ( 'vue-router' ) [ 'RouterLink' ]
2627 RouterView : typeof import ( 'vue-router' ) [ 'RouterView' ]
2728 }
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ const value1 = ref(true)
3232 <el-button size =" large" @click =" toast" >
3333 El Message
3434 </el-button >
35+
36+ <MessageBoxDemo />
3537 </div >
3638
3739 <div class =" my-2 flex flex-wrap items-center justify-center text-center" >
Original file line number Diff line number Diff line change 1+ <script lang="ts" setup>
2+ import type { Action } from ' element-plus'
3+ import { ElMessage , ElMessageBox } from ' element-plus'
4+
5+ function open() {
6+ ElMessageBox .alert (' This is a message' , ' Title' , {
7+ // if you want to disable its autofocus
8+ // autofocus: false,
9+ confirmButtonText: ' OK' ,
10+ callback : (action : Action ) => {
11+ ElMessage ({
12+ type: ' info' ,
13+ message: ` action: ${action } ` ,
14+ })
15+ },
16+ })
17+ }
18+ </script >
19+
20+ <template >
21+ <el-button plain @click =" open" >
22+ Click to open the Message Box
23+ </el-button >
24+ </template >
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import '~/styles/index.scss'
1717import 'uno.css'
1818// If you want to use ElMessage, import it.
1919import 'element-plus/theme-chalk/src/message.scss'
20+ import 'element-plus/theme-chalk/src/message-box.scss'
2021
2122// if you do not need ssg:
2223// import { createApp } from "vue";
You can’t perform that action at this time.
0 commit comments