-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvusui-layer.vue
84 lines (82 loc) · 2.04 KB
/
vusui-layer.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
<!--
* @Name:vusui-app-layer [layer] 层入口
* @Site:http://www.vusui.com | https://vusui.github.io
* @Author:林攀
* @License:MIT
* @开发日期:2019-12-18
-->
<template>
<view>
<block v-if="options.dialog.show">
<vus-mask :options="options.dialog" />
<vus-dialog v-if="options.dialog.show" />
</block>
<block v-else-if="options.message.show">
<vus-mask :options="options.message" />
<vus-msg v-if="options.message.show" />
</block>
<block v-else-if="options.loading.show">
<vus-mask :options="options.loading" />
<vus-load v-if="options.loading.show" />
</block>
<block v-if="options.prompt.show">
<vus-mask :options="options.prompt" />
<vus-prompt v-if="options.prompt.show" />
</block>
<block v-if="options.drawer.show">
<vus-mask :options="options.drawer" />
<vus-drawer v-if="options.drawer.show">
<slot name="drawer"></slot>
</vus-drawer>
</block>
<block v-else-if="options.page.show">
<vus-mask :options="options.page" />
<vus-page v-if="options.page.show">
<slot name="page"></slot>
</vus-page>
</block>
<block v-else-if="options.photos.show">
<vus-mask :options="options.photos" />
<vus-photos v-if="options.photos.show">
<slot name="photos"></slot>
</vus-photos>
</block>
</view>
</template>
<script>
import Util from './common/utils.js';
import vusMask from "./components/vus-mask.vue";
import vusDialog from "./components/vus-dialog.vue";
import vusMsg from "./components/vus-msg.vue";
import vusLoad from "./components/vus-load.vue";
import vusPrompt from "./components/vus-prompt.vue";
import vusDrawer from "./components/vus-drawer.vue";
import vusPage from "./components/vus-page.vue";
import vusPhotos from "./components/vus-photos.vue";
export default {
name: 'vusLayer',
data() {
return {}
},
components: {
vusMask,
vusDialog,
vusMsg,
vusLoad,
vusPrompt,
vusDrawer,
vusPage,
vusPhotos
},
computed: {
options() {
return this.$vusuiLayer.state;
}
},
beforeDestroy() {
this.vusui.closeAll();
}
}
</script>
<style>
</style>