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环境都出问题,能启动,但是页面路径对不上

     

  • 相关阅读:
    react-native-code-push进阶及实践小结
    Redux 基础
    iOS启动图异常修复方案 -(baidu)
    pod init
    Texture的异步渲染和布局引擎
    iOS 12.1 Tabbar 跳动Bug
    基本绘图的几种方式
    OC 小代码块
    OC基础--类的本质
    OC基础--构造方法 id类型
  • 原文地址:https://www.cnblogs.com/rachelch/p/7988509.html
Copyright © 2011-2022 走看看