Giter Club home page Giter Club logo

Comments (8)

F-loat avatar F-loat commented on June 18, 2024

这样直接访问 bar-app 吗,这个主要需要服务端做相应支持,使得直接访问子应用时返回主应用的 html 文件,单独访问子应用则使用特定的路径 bar-app/source.html

from vue-cli-plugin-qiankun.

hp6120c avatar hp6120c commented on June 18, 2024

是的,重定向是一种做法,但总感觉不是那么的爽,而且当项目庞大时需要维护一个很长的nginx配置文件,所以更倾向于一种纯前端解决的方式,qiankun官网的demo只有开发者模式还没仔细看如何build。不知道官网的例子里是否有解决方案

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 18, 2024

你们的子应用有单独访问的需求吗,目前是怎么部署的?

我这个仓库相当于把所有应用部署在了一起,这样 nginx 其实正常配置一下就行,只是子项目不能生成 index.html 文件了

分开部署的话其实是没有这个问题的

from vue-cli-plugin-qiankun.

hp6120c avatar hp6120c commented on June 18, 2024

我们可能有单独访问的需求,但我现在只是把你的examples build以后再用anywhere打开主应用的index,不用单独访问子应用就默认首页刷新就找不到了,如果真是这样的话每个子应用nginx都做下重定向肯定是不合理的

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 18, 2024

默认会打开 foo-app 这个子应用,nginx 加一条这个配置就行

location / {
  try_files $uri $uri/ /index.html;
}

from vue-cli-plugin-qiankun.

hp6120c avatar hp6120c commented on June 18, 2024

试了下一样的,可能是我把你demo里的一些配置改了下,当时发现编译后直接dist里起anywhere资源加了/vue-cli-plugin-qiankun/,就把主应用里APP.vue里的改了下,但应该不改也是一样的,我等会改回去再试下。如果方便的话可以加个微信好沟通,我微信号hp6120c

from vue-cli-plugin-qiankun.

F-loat avatar F-loat commented on June 18, 2024

生产环境下改了 publicPath,你可以自己试试看先 .env.production

from vue-cli-plugin-qiankun.

hp6120c avatar hp6120c commented on June 18, 2024

试过了,还是不行

from vue-cli-plugin-qiankun.

Related Issues (14)

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.