优化web库的体积

This commit is contained in:
aixianling
2022-11-18 16:39:09 +08:00
parent 9fc84a5ebf
commit 4ac0d0b7d8
4 changed files with 26 additions and 42 deletions

View File

@@ -0,0 +1,45 @@
<template>
<section class="appEntry">
<component v-if="app" :is="app" ref="currentPage" :instance="$request" :dict="$dict" :permissions="$permissions"/>
<ai-empty v-else>无法找到应用文件</ai-empty>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "appEntry",
label: "应用库-应用",
computed: {
...mapState(['apps']),
app() {
let app = this.apps.find(e => e.name == this.$route.name)
return app ? app.module : ""
}
},
mounted() {
this.$vm.$on("mock", v => {
if (!!this.$refs.currentPage.$children?.[0]?.form) {
this.$refs.currentPage.$children[0].form = v
this.$refs.currentPage.$children[0].$forceUpdate()
}
})
}
}
</script>
<style lang="scss" scoped>
.appEntry {
width: 100%;
flex: 1;
min-width: 0;
min-height: 0;
height: 100%;
& > * {
height: 100%;
}
}
</style>