forked from N3-components/N3-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
n3Loading.vue
56 lines (52 loc) · 1.07 KB
/
n3Loading.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
<template>
<span :class="classObj">
<i :class="iclassObj"></i>
<slot></slot>
</span>
</template>
<script>
export default{
props: {
type: {
type: String
},
size: {
type: String
},
center: {
type: Boolean
},
fixed: {
type: Boolean,
default: false
},
color: {
type: String
},
prefixCls: {
type: String,
default: 'n3'
}
},
computed: {
classObj () {
let {prefixCls, center, fixed} = this
let klass = {}
klass['affix'] = fixed
klass[prefixCls + '-page-loading-con'] = true
klass[prefixCls + '-page-loading-con'] = true
klass[prefixCls + '-loading-center'] = center
return klass
},
iclassObj () {
let {prefixCls, type, size, color} = this
let klass = {}
klass[prefixCls + '-page-loading'] = true
type ? klass[prefixCls + '-loading-' + type] = true : ''
size ? klass[prefixCls + '-loading-' + size] = true : ''
color ? klass['text-' + color] = true : ''
return klass
}
}
}
</script>