Giter Site home page Giter Site logo

Comments (8)

YuxinChou avatar YuxinChou commented on August 25, 2024 3

@baselin 你好,找到问题了,不是nginx问题,上面的配置是对的。

当换成history模式,可能引用路径和hash # 是不一样的。
这里修改config文件夹下的index.js,原来:

assetsPublicPath: './',
staticPath:'./',

修改后:

assetsPublicPath: '/',
staticPath:'/',

主要问题出在这里,重新打包、部署,测试可行。问题关闭啦。

from vue-element-admin.

PanJiaChen avatar PanJiaChen commented on August 25, 2024

配置上没看出什么问题
能截个图么?

from vue-element-admin.

YuxinChou avatar YuxinChou commented on August 25, 2024

nginx配置如下:
15f7ba05-3ae0-4316-9efa-cc791de227b7

错误如下:
图1:
b8551af4-3dfd-4acb-bbe3-0d0ce141bd63
图2:
1f40dfb6-9c72-4fc5-b22a-69f6fb615efc

from vue-element-admin.

PanJiaChen avatar PanJiaChen commented on August 25, 2024

introduction/js 是什么 哪来的。。。

from vue-element-admin.

YuxinChou avatar YuxinChou commented on August 25, 2024

原本的页面“简述” http://localhost:9528/#/introduction/index
我只是把#去掉了,在router的mode这里,改成了history。
export default new Router({
mode: 'history',

from vue-element-admin.

YuxinChou avatar YuxinChou commented on August 25, 2024

js所有文件都在dist/js文件夹下面,但是URL如果是localhost:9528/introduction/index等localhost:9528/###/***格式,网页会去dist的###文件夹下找js,这就导致不对。我估计

from vue-element-admin.

baselin avatar baselin commented on August 25, 2024

不是说去掉#号history模式需要node配合吗?vue官方的配置也是这种错误,搞了一天nginx配置都不行,你们有谁配置成功了告诉我一下谢谢~~~~~

from vue-element-admin.

baselin avatar baselin commented on August 25, 2024

@YuxinChou 谢谢啦 ~~~~

from vue-element-admin.

Related Issues (20)

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.