Git Product home page Git Product logo

hel-tep-vue-router's Introduction

vue-admin-template-with-hel

基于 vue-admin-template 改造为远程模块,详细改造说明见 HEL_DESC.md

改造说明(from HEL_DESC)

提供方改造

安装相关包

npm i hel-lib-proxy hel-dev-utils [email protected] rollup@2 rollup-plugin-typescript rollup-plugin-terser shx

下沉入口文件

将原来的 src/main.js 内容复制到 src/loadApp.js

新增模块暴露目录

新增 src/entrance 目录作为统一暴露模块的出口目录

新增模块名描述文件

新增 src/configs/subApp.js 文件描述模块名

改造 main.js

引入 hel-lib-proxy 包,做分流控制

构建层引入模块描述文件

根目录引入 subApp.js 文件,对接 hel-dev-utils,供构建工具的vue.config.js文件使用,主要改动有

发布

npm run build npm publish

使用方使用

入口文件先绑定vue运行时

import { bindVueRuntime } from 'hel-micro';
import Vue from 'vue';
bindVueRuntime({Vue});

懒加载

export default {
  components: {
    Hamburger: defineAsyncComponent(async () => {
      const comps = await preFetchLib("lib-zhangbb-component");
      return comps.Hamburger;
    }),
  },
};

预加载

原入口文件下沉,然后加载远程模块,参考 https://github.com/hel-eco/hel-demo-use-remote-vue3-comp/blob/main/src/main.ts

await preFetchLib('lib-zhangbb-component')

然后安装lib-zhangbb-component, 其他地方可import 静态导入模块

import { Hamburger } from 'lib-zhangbb-component';

hel-dev-utils hel-lib-proxy hel-iso

hel-tep-vue-router's People

Contributors

zhangbinzhbb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.