module.vue
1.25 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
<template>
<div class="mwraper">
<component ref="module" :is="mkey" :title="title" :ckey="ckey" :icon="icon" :data="data" :level="level" :pagination="pagination" :action="action">
<template slot="action">
<slot name="action"/>
</template>
</component>
</div>
</template>
<script>
//import mallOptionContent from './mallOptionContent'
import moduleData,{loadModule} from '../module';
//loadModule('card')
export default {
props: {
mkey: String,
ckey: String,
title:String,
icon:String,
data:Object,
level:Array,
action:Boolean,
pagination:Boolean
},
inject: ['addModule'],
components: {
...moduleData
},
data() {
return {
}
},
methods: {
},
created() {
if(!this.mkey||!Object.keys(moduleData).includes(this.mkey)){
return console.error('不存在指定的module:',this.mkey);
}
},
mounted(){
this.addModule(this.$refs.module);
}
}
</script>
<style scoped>
.mwraper{
background: #fff;
box-sizing: border-box;
position: relative;
width: 100%;
padding: 16px 20px;
}
</style>