Coder Social home page Coder Social logo

joycezhangw / qiankun-vue-demo Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 2.45 MB

微前端解决方案qiankun测试用例,主应用及子应用均为vue-cli 4 构建,实现在主应用自己的页面和子应用的页面自由跳转

License: Other

JavaScript 57.50% HTML 2.44% CSS 2.17% Vue 33.49% Shell 0.09% Less 4.31%
vue qiankun vue-cli-4 vuejs2

qiankun-vue-demo's Introduction

项目介绍

  • 使用 qiankun 来实现 vue 技术栈的微前端服务
  • 主应用和子应用都是使用 history 路由模式
  • 主应用不仅只是微前端的基座,它也有自己的业务承载,实现在主应用自己的页面和子应用的页面自由跳转
  • 主/子应用,都是使用 vue-cli 4 下创建的vue项目,单独运行项目命令,请参照 Vue CLI 官方文档

目录结构

├─bin                                整个项目的打包,运行执行目录
│  ├─install.js                      安装所有项目依赖
│  ├─start.js                        启动dev项目
│  └─build.js                        打包所有项目
| 
├─master                             主应用
│  ├─src               
│  │  ├─config                        项目配置目录
│  │  ├─core                          项目初始化目录
│  │  ├─├─registerMicroApps.js        注册qiankun子应用
│  │  ├─├─install.js                  全局插件
│  │  ├─├─render.js                   vue初始化
│  │  ├─└─...           
│  │  ├─plugins                       第三方插件目录
│  │  ├─├─element.js                  elementUI 入口
│  │  ├─├─install.js                  注册第三方插件
│  │  ├─└─...            
│  │  └─ ...                          更多vue目录
│  │
│
├─subapp-test               子应用
│  ├─src                    
│  │  └─...                 

│
├─package.json          整个微前端服务模块描述文件
├─LICENSE.txt           授权说明文件
├─README.md             README 文件

运行和打包

安装微应用依赖教程

npm run hm-install-all

项目启动开发环境

npm run hm-serve-all

打包所有项目

npm run hm-build-all

您也可以使用 npm-run-all 插件来实现:一个命令,运行所有项目,该插件要在根目录下创建package.json然后进行npm install npm-run-all --save-dev

npm-run-all 开源地址,文档

说明

更多关于qiankun实践文章,请看作者:沉末_ qiankun 微前端方案实践及总结

感谢

qiankun-vue-demo's People

Contributors

dependabot[bot] avatar joycezhangw avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

dczhangtw

qiankun-vue-demo's Issues

请问 运行npm run hm-serve-all后报错,是怎么回事呢?

请问运行npm run hm-serve-all后页面分别报如下错误

Module not found: Error: Can't resolve './modules' in 'E:\HBuilderProjects\qiankun-vue-demo\master\src\store'

Module not found: Error: Can't resolve './modules' in 'E:\HBuilderProjects\qiankun-vue-demo\subapp-test\src\store'

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.