swico 2.6.0-beta.4 → 2.6.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/index.vue.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { GlobalData, GlobalSwicoConfigType } from './main-config';
|
|
2
2
|
import { App } from 'vue';
|
|
3
3
|
import { Router } from 'vue-router';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {
|
|
5
|
+
SwicoLoading: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
export default _default;
|
|
4
8
|
export type CustomConfigType = GlobalData['customConfig'];
|
|
5
|
-
export { RouterView
|
|
9
|
+
export { RouterView } from 'vue-router';
|
|
6
10
|
export { useLocation, useNav } from './project-path/.swico-vue/hooks';
|
|
7
11
|
export { history } from './mock-history';
|
|
8
12
|
export type { GlobalSwicoConfigType };
|
|
9
|
-
export {
|
|
13
|
+
export declare const Outlet: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
10
14
|
export interface DefineSwicoConfigType {
|
|
11
15
|
(env: 'base', config: CustomConfigType['base']): any;
|
|
12
16
|
(env: 'dev', config: CustomConfigType['dev']): any;
|
package/src/index.vue.js
CHANGED
|
@@ -3,16 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defineGlobal = exports.defineConfig = exports.
|
|
6
|
+
exports.defineGlobal = exports.defineConfig = exports.Outlet = exports.history = exports.useNav = exports.useLocation = exports.RouterView = void 0;
|
|
7
|
+
const vue_1 = require("vue");
|
|
8
|
+
const loading_1 = __importDefault(require("./project-path/.swico-vue/loading"));
|
|
9
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
10
|
+
components: { SwicoLoading: loading_1.default }
|
|
11
|
+
});
|
|
7
12
|
var vue_router_1 = require("vue-router");
|
|
8
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "RouterView", { enumerable: true, get: function () { return vue_router_1.RouterView; } });
|
|
9
14
|
var hooks_1 = require("./project-path/.swico-vue/hooks");
|
|
10
15
|
Object.defineProperty(exports, "useLocation", { enumerable: true, get: function () { return hooks_1.useLocation; } });
|
|
11
16
|
Object.defineProperty(exports, "useNav", { enumerable: true, get: function () { return hooks_1.useNav; } });
|
|
12
17
|
var mock_history_1 = require("./mock-history");
|
|
13
18
|
Object.defineProperty(exports, "history", { enumerable: true, get: function () { return mock_history_1.history; } });
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
exports.Outlet = (0, vue_1.defineComponent)({
|
|
20
|
+
name: 'Outlet',
|
|
21
|
+
template: '<RouterView v-slot="{ Component }"><template v-if="Component"><Suspense><component :is="Component"></component><template #fallback><SwicoLoading /></template></Suspense></template></RouterView>'
|
|
22
|
+
});
|
|
16
23
|
const defineConfig = (env, config) => config;
|
|
17
24
|
exports.defineConfig = defineConfig;
|
|
18
25
|
const defineGlobal = (config) => config;
|
|
@@ -19,26 +19,12 @@ const Container = (0, vue_1.defineComponent)({
|
|
|
19
19
|
});
|
|
20
20
|
return { error };
|
|
21
21
|
},
|
|
22
|
-
template: '
|
|
23
|
-
' <RouterView v-slot="{ Component }">\n' +
|
|
24
|
-
' <template v-if="Component">\n' +
|
|
25
|
-
' <Suspense>\n' +
|
|
26
|
-
' <!-- 主要内容 -->\n' +
|
|
27
|
-
' <component :is="Component"></component>\n' +
|
|
28
|
-
'\n' +
|
|
29
|
-
' <!-- 加载中状态 -->\n' +
|
|
30
|
-
' <template #fallback>\n' +
|
|
31
|
-
' <Loading />\n' +
|
|
32
|
-
' </template>\n' +
|
|
33
|
-
' </Suspense>\n' +
|
|
34
|
-
' </template>\n' +
|
|
35
|
-
' </RouterView>\n' +
|
|
36
|
-
' </Layout>'
|
|
22
|
+
template: '<SwicoLayout v-if="!error"></SwicoLayout>'
|
|
37
23
|
});
|
|
38
24
|
const router = (0, history_1.getRouter)();
|
|
39
25
|
const app = (0, vue_1.createApp)(Container);
|
|
40
|
-
app.component('
|
|
41
|
-
app.component('
|
|
26
|
+
app.component('SwicoLayout', Layout_1.default);
|
|
27
|
+
app.component('SwicoLoading', loading_1.default);
|
|
42
28
|
app.use(router);
|
|
43
29
|
(_a = global_1.default === null || global_1.default === void 0 ? void 0 : global_1.default.onInit) === null || _a === void 0 ? void 0 : _a.call(global_1.default, app, router);
|
|
44
30
|
app.mount('#root');
|