forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic.vue
More file actions
62 lines (59 loc) · 1.53 KB
/
Basic.vue
File metadata and controls
62 lines (59 loc) · 1.53 KB
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
<template>
<div class="q-pa-md q-gutter-sm">
<q-btn label="Alert" color="primary" @click="alert" />
<q-btn label="Confirm" color="primary" @click="confirm" />
<q-btn label="Prompt" color="primary" @click="prompt" />
</div>
</template>
<script>
export default {
methods: {
alert () {
this.$q.dialog({
title: 'Alert',
message: 'Some message'
}).onOk(() => {
// console.log('OK')
}).onCancel(() => {
// console.log('Cancel')
}).onDismiss(() => {
// console.log('I am triggered on both OK and Cancel')
})
},
confirm () {
this.$q.dialog({
title: 'Confirm',
message: 'Would you like to turn on the wifi?',
cancel: true,
persistent: true
}).onOk(() => {
// console.log('>>>> OK')
}).onOk(() => {
// console.log('>>>> second OK catcher')
}).onCancel(() => {
// console.log('>>>> Cancel')
}).onDismiss(() => {
// console.log('I am triggered on both OK and Cancel')
})
},
prompt () {
this.$q.dialog({
title: 'Prompt',
message: 'What is your name?',
prompt: {
model: '',
type: 'text' // optional
},
cancel: true,
persistent: true
}).onOk(data => {
// console.log('>>>> OK, received', data)
}).onCancel(() => {
// console.log('>>>> Cancel')
}).onDismiss(() => {
// console.log('I am triggered on both OK and Cancel')
})
}
}
}
</script>