-
Notifications
You must be signed in to change notification settings - Fork 17
/
app.vue
147 lines (139 loc) · 3.85 KB
/
app.vue
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<script setup lang="ts">
import { $message } from './utils'
const { t } = useLocale()
const drawer = ref(false)
const dialogVisible = ref(false)
const loading = ref(true)
onMounted(() => {
ElNotification({
title: 'Success',
message: 'This is a success message',
type: 'success'
})
setTimeout(() => {
loading.value = false
}, 10000)
})
function hello () {
ElMessageBox.confirm(
'proxy will permanently delete the file. Continue?',
'Warning',
{
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'warning'
}
)
.then(() => {
$message('Delete completed')
})
.catch(() => {
$message('Delete canceled')
})
}
function changeTheme () {
const html = document.querySelector('html')!
html.classList.toggle('dark')
}
</script>
<template>
<el-config-provider>
<el-container>
<el-header>
<header-menu />
</el-header>
<el-main>
<el-card class="mb-5">
<el-space wrap size="large">
<el-dropdown type="primary">
<el-button type="primary">
Dropdown List
<el-icon class="el-icon--right">
<el-icon-arrow-down />
</el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>Action 1</el-dropdown-item>
<el-dropdown-item>Action 2</el-dropdown-item>
<el-dropdown-item>Action 3</el-dropdown-item>
<el-dropdown-item>Action 4</el-dropdown-item>
<el-dropdown-item>Action 5</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-popover
:teleported="true"
placement="bottom"
title="Title"
trigger="hover"
>
<template #reference>
<el-button type="primary" class="el-dropdown-link">
Popover
</el-button>
</template>
<div>test1</div>
</el-popover>
<el-button :icon="ElIconEditPen" type="success" @click="hello">
{{ t('el.colorpicker.confirm') }}
</el-button>
<ElButton @click="hello">
Open Dialog
</ElButton>
<el-button type="primary" @click="drawer = true">
Open Drawer
</el-button>
<el-button type="danger" @click="changeTheme">
Change Theme
</el-button>
<LazyElButton type="warning" @click="$message('come from Lazy Button')">
Lazy Button
</LazyElButton>
<el-text class="mx-1" size="large">
el-text
</el-text>
<el-link href="https://element-plus.org" type="primary" target="_blank">
element-plus
</el-link>
</el-space>
</el-card>
<form-card />
<table-card v-loading="loading" />
<tree-card />
<data-card />
<navigation-card />
<other-card />
</el-main>
<el-footer>
<icon-card />
</el-footer>
</el-container>
<el-drawer v-model="drawer" title="I am the title" append-to-body>
<span>Hi there!</span>
</el-drawer>
<el-dialog
v-model="dialogVisible"
title="Tips"
append-to-body
>
<span>This is a message</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">Cancel</el-button>
<el-button type="primary" @click="dialogVisible = false">
Confirm
</el-button>
</span>
</template>
</el-dialog>
</el-config-provider>
</template>
<style>
.mb-5 {
margin-bottom: 20px;
}
.mr-4 {
margin-right: 16px;
}
</style>