Skip to content

Commit 88febc5

Browse files
author
xujianhua
committed
动态添加路由函数优化
1 parent 588d8ce commit 88febc5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/views/layoutpages/common.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/*
22
* @Author: your name
33
* @Date: 2021-02-07 17:11:28
4-
* @LastEditTime: 2021-08-13 11:43:36
4+
* @LastEditTime: 2021-08-18 17:51:13
55
* @LastEditors: Please set LastEditors
66
* @Description: In User Settings Edit
77
* @FilePath: \vue3-element-admin\src\views\layoutpages\common.js
88
*/
9-
import { defineAsyncComponent } from "vue";
10-
import FunctionPage from "@/components/FunctionPage";
119

1210
/**
1311
* @description:提交搜索
@@ -102,9 +100,17 @@ export const getAsyncRouteName = async (
102100
name,
103101
{ router, route }
104102
) => {
105-
const AsyncComponent = defineAsyncComponent(() =>
106-
import("@/views/layoutpages/" + path + ".vue")
107-
);
103+
const FunctionPage = require("@/components/FunctionPage.vue").default;
104+
const AsyncComponent = require("@/views/layoutpages/" +
105+
path +
106+
".vue").default;
107+
// const { defineAsyncComponent } = require("vue");
108+
// const AsyncComponent = defineAsyncComponent(() =>
109+
// import("@/views/layoutpages/" + path + ".vue")
110+
// );
111+
// import { defineAsyncComponent } from "vue";
112+
// import FunctionPage from "@/components/FunctionPage";
113+
108114
const app = {
109115
components: {
110116
FunctionPage,

0 commit comments

Comments
 (0)