-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.vue
124 lines (115 loc) · 3.02 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
<template>
<div id="app-container">
<DxTabPanel
@selection-changed="switchSDAs">
<DxItem title="Edit tab">
<template #default>
<p>Edit tab's content</p>
</template>
</DxItem>
<DxItem title="Share tab">
<template #default>
<p>Share tab's content</p>
</template>
</DxItem>
</DxTabPanel>
<DxSpeedDialAction
hint="Edit"
icon="ion ion-md-create"
:visible="currentTab === 'Edit tab'"
@click="showNotification('Edit is clicked')"
/>
<DxSpeedDialAction
hint="Copy to clipboard"
icon="ion ion-md-copy"
:visible="currentTab === 'Share tab'"
@click="showNotification('Copied to clipboard')"
/>
<DxSpeedDialAction
hint="Send by email"
icon="ion ion-md-mail"
:visible="currentTab === 'Share tab'"
@click="showNotification('Sent by email')"
/>
<DxSpeedDialAction
hint="Share on Facebook"
icon="ion ion-logo-facebook"
:visible="currentTab === 'Share tab'"
@click="showNotification('Shared on Facebook')"
/>
</div>
</template>
<script>
import 'devextreme/dist/css/dx.common.css';
import 'devextreme/dist/css/dx.material.blue.light.css';
// Custom icons by Ionicons
import 'ionicons/dist/css/ionicons.css';
import DxTabPanel, { DxItem } from 'devextreme-vue/tab-panel';
import DxSpeedDialAction from 'devextreme-vue/speed-dial-action';
import notify from 'devextreme/ui/notify';
import config from 'devextreme/core/config';
config({
floatingActionButtonConfig: {
icon: 'icon ion-md-share',
position: {
my: 'right bottom',
at: 'right bottom',
of: '#app-container',
offset: '-16 -16'
}
}
});
export default {
components: {
DxTabPanel,
DxItem,
DxSpeedDialAction
},
data() {
return {
currentTab: 'Edit tab'
}
},
methods: {
switchSDAs(e) {
this.currentTab = e.addedItems[0].title;
},
showNotification(message) {
notify({
message: message,
position: {
my: 'left bottom',
at: 'left bottom',
of: '#app-container',
offset: '16 -16'
},
minWidth: null,
width: 320 * 0.7
}, "info", 1000);
}
}
}
</script>
<style>
.dx-fa-button-icon, .dx-fa-button-icon-close {
text-align: center;
}
p {
text-align: center;
}
#app-container {
height: 360px;
width: 320px;
border: 1px solid black;
}
.dx-tabpanel .dx-tabs-wrapper {
display: flex;
flex-flow: row nowrap;
}
.dx-tab {
display: flex;
flex-flow: row nowrap;
flex: 1;
justify-content: center;
}
</style>