解决pages页面不显示问题

This commit is contained in:
icssoa 2022-08-01 14:16:37 +08:00
parent df99ebfc8e
commit d4759fecca
6 changed files with 30 additions and 26 deletions

View File

@ -1,6 +1,6 @@
{
"name": "front-next",
"version": "5.7.6",
"version": "5.7.7",
"scripts": {
"dev": "vite --host",
"build": "vite build",

View File

@ -55,28 +55,27 @@ router.append = function (data) {
d.name = d.path.substring(1);
}
if (!d.component) {
const url = d.viewPath;
if (url) {
if (url.indexOf("http") == 0) {
if (d.meta) {
d.meta.iframeUrl = url;
}
d.component = () => import(`/$/base/views/frame.vue`);
} else {
d.component = files["/src/" + url.replace("cool/", "")];
}
} else {
d.redirect = "/404";
}
}
if (e.isPage) {
router.addRoute(d);
} else {
if (!d.component) {
const url = d.viewPath;
if (url) {
if (url.indexOf("http") == 0) {
if (d.meta) {
d.meta.iframeUrl = url;
}
d.component = () => import(`/$/base/views/frame.vue`);
} else {
d.component = files["/src/" + url.replace("cool/", "")];
}
} else {
d.redirect = "/404";
}
}
// @ts-ignore
router.addRoute("index", d);
}
});

View File

@ -1,9 +1,9 @@
<template>
<div class="app-views">
<router-view v-slot="{ Component }">
<keep-alive :include="caches">
<component :is="Component" />
</keep-alive>
<!-- <keep-alive :include="caches"> -->
<component :is="Component" />
<!-- </keep-alive> -->
</router-view>
</div>
</template>

View File

@ -7,7 +7,7 @@
<li @click="refresh()">
<el-tooltip content="刷新">
<el-icon>
<refresh />
<refresh-icon />
</el-icon>
</el-tooltip>
</li>
@ -77,7 +77,7 @@ import { useCool } from "/@/cool";
import { deepTree, revDeepTree } from "/@/cool/utils";
import { isArray } from "lodash";
import { ContextMenu, useForm } from "@cool-vue/crud";
import { Refresh, Operation, MoreFilled } from "@element-plus/icons-vue";
import { Refresh as RefreshIcon, Operation, MoreFilled } from "@element-plus/icons-vue";
import { useBase, checkPerm } from "/$/base";
const props = defineProps({

View File

@ -4,7 +4,7 @@
</div>
</template>
<script lang="ts" setup>
<script lang="ts" name="frame" setup>
import { ref, watch, onMounted } from "vue";
import { useCool } from "/@/cool";

View File

@ -0,0 +1,5 @@
<template>
<div>Test</div>
</template>
<script lang="ts" name="tt" setup></script>