zoukankan      html  css  js  c++  java
  • vux构建的项目打包成app出的一些问题

    1.static里面能放一些外部的插件,css可以放static,引用的时候按照相对路径写,

    less不可以,因为放在static里面的文件不会经过webpack的处理,所以也就不会编译成css,所以浏览器识别不了,

    一些比较庞大的文件,比如bootstrap库,且经过压缩的,可以放static,这样打包的时候就不会等很久。

    2.底部的路由跳转,路径要改为./

    即:

    <template>
      <div v-show="isFooter" id="appFooter">
        <tabbar>
          <tabbar-item selected link="./home">
            <i slot="icon" class="iconfont icon-homebig"></i>
            <span slot="label">首页</span>
          </tabbar-item>
          <tabbar-item link="./appIndustry">
              <i slot="icon" class="iconfont icon-menu_park"></i>
            <span slot="label">企业</span>
          </tabbar-item>
          <tabbar-item link="./appOptional">
              <i slot="icon" class="iconfont icon-fenlei"></i>
            <span slot="label">自选</span>
          </tabbar-item>
          <tabbar-item link="./appShealdeal">
              <i slot="icon" class="iconfont icon-rongzi"></i>
            <span slot="label">融资</span>
          </tabbar-item>
           <tabbar-item link="./appInformation">
               <i slot="icon" class="iconfont icon-daohangzixun"></i>
            <span slot="label">资讯</span>
          </tabbar-item>
        </tabbar>
      </div>
    </template>

    3.外部引入的东西可以直接放在index.html里面

    4.之前为了去掉页面链接中的#,使用了mode:history,这样之后打包也会有问题,因此不能去掉#号

    5.【最重要】在npm run build 之前要先去config ->index.js里面改些配置

    在build里面配置assetsPublicPath为 “ ./  ”,配置之前是 “ / ”

    dev里面无须配置,如果添加了“  .  ”,dev环境都出问题,能启动,但是页面路径对不上

     

  • 相关阅读:
    hdu 5723 Abandoned country 最小生成树 期望
    OpenJ_POJ C16G Challenge Your Template 迪杰斯特拉
    OpenJ_POJ C16D Extracurricular Sports 打表找规律
    OpenJ_POJ C16B Robot Game 打表找规律
    CCCC 成都信息工程大学游记
    UVALive 6893 The Big Painting hash
    UVALive 6889 City Park 并查集
    UVALive 6888 Ricochet Robots bfs
    UVALive 6886 Golf Bot FFT
    UVALive 6885 Flowery Trails 最短路
  • 原文地址:https://www.cnblogs.com/rachelch/p/7988509.html
Copyright © 2011-2022 走看看