Giter Site home page Giter Site logo

qiankun-demo's Introduction

基于qiankun,前端微服务说明

开始

父应用、子应用1、子应用2都可以单独进入文件夹,分别运行命令启动服务

npm install
npm run serve

效果

三个服务都成功启动后,可以看到三个页面都可以单独访问。

最终效果就是:在父应用页面内,可以看到里面的两个子应用服务效果类似iframe。 show

为什么用qiankun,不用iframe

微前端的优势不作说明,项目只提供解决方案 可以在官方手册,看到更多介绍


手动启动服务可以不看以下,这个是个人使用,所以一起扔上来了。


最外层server.js脚本

在每个项目内都npm install过后,每次都要在相应的目录内npm run serve, 为了避免每次启动需要三个命令,直接写一个node脚本,一次性启动全部应用,用法

  • 在最外层目录: ./qiankun-demo 目录下
node server.js

即可

第一次运行 也需要

npm install

其中涉及并行和串行可以自行了解

  • async.series()
  • async.parallel

qiankun-demo's People

Contributors

chenjing0823 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.