From 15c93eb80e17fdb15a926b0e2450a4bc57be93b7 Mon Sep 17 00:00:00 2001 From: wanchun <445436867@qq.com> Date: Fri, 6 May 2022 15:02:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20layout/locale/editor/sass=E7=AD=89?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=85=BC=E5=AE=B9vite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fes-plugin-layout/src/index.js | 2 +- .../fes-plugin-layout/src/runtime/runtime.js | 36 ++--- .../src/runtime/views/BaseLayout.vue | 144 ++++++------------ .../src/runtime/views/Menu.vue | 62 ++++---- .../src/runtime/views/MenuIcon.vue | 13 +- packages/fes-plugin-locale/src/index.js | 5 +- .../fes-plugin-locale/src/runtime/core.tpl | 14 +- packages/fes-plugin-locale/src/utils/index.js | 24 +-- .../fes-plugin-monaco-editor/package.json | 3 +- .../fes-plugin-monaco-editor/src/index.js | 18 ++- .../src/runtime/core.tpl | 2 +- packages/fes-plugin-sass/src/index.js | 41 ++--- .../src/plugins/features/globalCSS.js | 2 +- packages/fes-template-vite1/.env | 1 + packages/fes-template-vite1/.env.prod | 1 + packages/fes-template-vite1/.eslintrc.js | 11 ++ packages/fes-template-vite1/.fes.js | 90 +++++++++++ packages/fes-template-vite1/.fes.local.js | 5 + packages/fes-template-vite1/.fes.prod.js | 6 + packages/fes-template-vite1/.gitignore | 11 ++ packages/fes-template-vite1/LICENSE | 21 +++ packages/fes-template-vite1/README.md | 12 ++ packages/fes-template-vite1/__tests__/add.js | 5 + packages/fes-template-vite1/index.html | 20 +++ packages/fes-template-vite1/mock.js | 143 +++++++++++++++++ packages/fes-template-vite1/package.json | 66 ++++++++ packages/fes-template-vite1/public/logo.png | Bin 0 -> 33821 bytes .../public/wine-outline.svg | 1 + packages/fes-template-vite1/src/app.jsx | 27 ++++ .../fes-template-vite1/src/common/service.js | 19 +++ .../src/components/PageLoading.vue | 30 ++++ .../src/components/UserCenter.vue | 20 +++ packages/fes-template-vite1/src/global.css | 0 packages/fes-template-vite1/src/global.scss | 5 + .../fes-template-vite1/src/images/icon.png | Bin 0 -> 5586 bytes .../fes-template-vite1/src/locales/en-US.js | 8 + .../fes-template-vite1/src/locales/zh-CN.js | 8 + .../fes-template-vite1/src/models/user.js | 8 + .../src/pages/cssModule.vue | 24 +++ .../fes-template-vite1/src/pages/editor.vue | 42 +++++ .../fes-template-vite1/src/pages/index.vue | 32 ++++ .../src/pages/menuTest/@id.vue | 30 ++++ .../src/pages/menuTest/index.vue | 26 ++++ .../src/pages/menuTest/layout.vue | 8 + .../fes-template-vite1/src/pages/mock.vue | 47 ++++++ .../fes-template-vite1/src/pages/pinia.vue | 31 ++++ .../src/pages/route/@id.vue | 23 +++ .../fes-template-vite1/src/pages/store.vue | 60 ++++++++ packages/fes-template-vite1/src/store/main.js | 21 +++ .../fes-template-vite1/src/stores/counter.js | 23 +++ .../fes-template-vite1/src/stores/foo/bar.js | 23 +++ .../src/stores/plugin-loger.js | 3 + .../fes-template-vite1/src/stores/user.js | 54 +++++++ packages/fes-template-vite1/src/utils/sum.js | 3 + packages/fes-template-vite1/tsconfig.json | 38 +++++ packages/fes-template/.eslintrc.js | 11 +- packages/fes-template/src/app.js | 14 +- packages/fes-template/src/pages/index.vue | 7 +- yarn.lock | 5 + 59 files changed, 1178 insertions(+), 231 deletions(-) create mode 100644 packages/fes-template-vite1/.env create mode 100644 packages/fes-template-vite1/.env.prod create mode 100644 packages/fes-template-vite1/.eslintrc.js create mode 100644 packages/fes-template-vite1/.fes.js create mode 100644 packages/fes-template-vite1/.fes.local.js create mode 100644 packages/fes-template-vite1/.fes.prod.js create mode 100644 packages/fes-template-vite1/.gitignore create mode 100644 packages/fes-template-vite1/LICENSE create mode 100644 packages/fes-template-vite1/README.md create mode 100644 packages/fes-template-vite1/__tests__/add.js create mode 100644 packages/fes-template-vite1/index.html create mode 100644 packages/fes-template-vite1/mock.js create mode 100644 packages/fes-template-vite1/package.json create mode 100644 packages/fes-template-vite1/public/logo.png create mode 100644 packages/fes-template-vite1/public/wine-outline.svg create mode 100644 packages/fes-template-vite1/src/app.jsx create mode 100644 packages/fes-template-vite1/src/common/service.js create mode 100644 packages/fes-template-vite1/src/components/PageLoading.vue create mode 100644 packages/fes-template-vite1/src/components/UserCenter.vue create mode 100644 packages/fes-template-vite1/src/global.css create mode 100644 packages/fes-template-vite1/src/global.scss create mode 100644 packages/fes-template-vite1/src/images/icon.png create mode 100644 packages/fes-template-vite1/src/locales/en-US.js create mode 100644 packages/fes-template-vite1/src/locales/zh-CN.js create mode 100644 packages/fes-template-vite1/src/models/user.js create mode 100644 packages/fes-template-vite1/src/pages/cssModule.vue create mode 100644 packages/fes-template-vite1/src/pages/editor.vue create mode 100644 packages/fes-template-vite1/src/pages/index.vue create mode 100644 packages/fes-template-vite1/src/pages/menuTest/@id.vue create mode 100644 packages/fes-template-vite1/src/pages/menuTest/index.vue create mode 100644 packages/fes-template-vite1/src/pages/menuTest/layout.vue create mode 100644 packages/fes-template-vite1/src/pages/mock.vue create mode 100644 packages/fes-template-vite1/src/pages/pinia.vue create mode 100644 packages/fes-template-vite1/src/pages/route/@id.vue create mode 100644 packages/fes-template-vite1/src/pages/store.vue create mode 100644 packages/fes-template-vite1/src/store/main.js create mode 100644 packages/fes-template-vite1/src/stores/counter.js create mode 100644 packages/fes-template-vite1/src/stores/foo/bar.js create mode 100644 packages/fes-template-vite1/src/stores/plugin-loger.js create mode 100644 packages/fes-template-vite1/src/stores/user.js create mode 100644 packages/fes-template-vite1/src/utils/sum.js create mode 100644 packages/fes-template-vite1/tsconfig.json diff --git a/packages/fes-plugin-layout/src/index.js b/packages/fes-plugin-layout/src/index.js index 8b464115..209e5988 100644 --- a/packages/fes-plugin-layout/src/index.js +++ b/packages/fes-plugin-layout/src/index.js @@ -24,7 +24,7 @@ export default (api) => { api.addRuntimePluginKey(() => 'layout'); - const absFilePath = join(namespace, 'index.js'); + const absFilePath = join(namespace, 'index.jsx'); const absRuntimeFilePath = join(namespace, 'runtime.js'); diff --git a/packages/fes-plugin-layout/src/runtime/runtime.js b/packages/fes-plugin-layout/src/runtime/runtime.js index c676984f..eaeb72f0 100644 --- a/packages/fes-plugin-layout/src/runtime/runtime.js +++ b/packages/fes-plugin-layout/src/runtime/runtime.js @@ -1,13 +1,11 @@ import { plugin, ApplyPluginsType } from '@@/core/coreExports'; // eslint-disable-next-line import/extensions import { access as accessApi } from '../plugin-access/core'; -import Exception404 from './views/404'; -import Exception403 from './views/403'; +import Exception404 from './views/404.vue'; +import Exception403 from './views/403.vue'; if (!accessApi) { - throw new Error( - '[plugin-layout]: pLugin-layout depends on plugin-access,please install plugin-access first!' - ); + throw new Error('[plugin-layout]: pLugin-layout depends on plugin-access,please install plugin-access first!'); } const handle = (type, router) => { @@ -16,7 +14,7 @@ const handle = (type, router) => { const name = `Exception${type}`; const components = { 404: Exception404, - 403: Exception403 + 403: Exception403, }; if (!accesssIds.includes(path)) { accessApi.setAccess(accesssIds.concat([path])); @@ -26,18 +24,19 @@ const handle = (type, router) => { } }; -export const access = memo => ({ - unAccessHandler({ - router, to, from, next - }) { +export const access = (memo) => ({ + unAccessHandler({ router, to, from, next }) { const runtimeConfig = plugin.applyPlugins({ key: 'layout', type: ApplyPluginsType.modify, - initialValue: {} + initialValue: {}, }); if (runtimeConfig.unAccessHandler && typeof runtimeConfig.unAccessHandler === 'function') { return runtimeConfig.unAccessHandler({ - router, to, from, next + router, + to, + from, + next, }); } if (to.path === '/404') { @@ -47,17 +46,18 @@ export const access = memo => ({ handle(403, router); next('/403'); }, - noFoundHandler({ - router, to, from, next - }) { + noFoundHandler({ router, to, from, next }) { const runtimeConfig = plugin.applyPlugins({ key: 'layout', type: ApplyPluginsType.modify, - initialValue: {} + initialValue: {}, }); if (runtimeConfig.noFoundHandler && typeof runtimeConfig.noFoundHandler === 'function') { return runtimeConfig.noFoundHandler({ - router, to, from, next + router, + to, + from, + next, }); } if (to.path === '/403') { @@ -67,5 +67,5 @@ export const access = memo => ({ handle(404, router); next('/404'); }, - ...memo + ...memo, }); diff --git a/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue b/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue index 83065240..a6f24beb 100644 --- a/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue +++ b/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue @@ -12,26 +12,12 @@ >
9Mk;rrCM{^JkNl#s+NubVb>1rnpnm*UdQ
zy~-t#i&Utfn@{laE-YDg&Cv=GDNg9fRGDL^{7f3k2+x5gxg#Rl4Z@jJfkarjva{Qj
z)c>>`)~9Ir)!lX$#B@=*koeK?A834Y_|0Fp5;##t`JqUn4+If7EO-B~Vuex
+