利用HBuilder将vue项目打包成移动端app问题记录

记录自己遇到的问题,以备查询。

利用HBuilder将vue项目打包成移动端app问题记录

  • 1.首页空白问题
将vue项目打包成移动端app问题记录)

1.首页空白问题

config/index.js

build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    // 1.将 '/' 改为 './'
    assetsPublicPath: './',

router/index.js

export default new Router({
  // 2.不能使用history模式
  // mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/index'
    }
  ]
})

后续遇到问题再补充

你可能感兴趣的:(hbuilder,vue)