


This article mainly introduces the detailed explanation of Vue webapp project packaging native APP through HBulider. The content is quite good. Now I will share it with you and give it as a reference.
The Vue webapp project packages the native APP through HBulider
1. The webapp project has been written through the scaffolding built by vue-cli, and then packaged into a deployment file list through webpack, as follows :
2. Open HBulider, open the directory, select this list, and change the project name yourself. (Or create a new app project directly, and then keep the unpackage and manifest inside, and replace the others with the contents of your own dist file)
# This is a web project and needs to be changed to an APP project (if you create a new app directly, please ignore this step)
Before changing:
After changes:
3. Open this dist in HB, and you can see that there is a manifest.json file. This file is used to configure application information. The entry file must correspond well. I used VUE to write a single-page application, so there is only one index.html.
Then configure the icon
#Just configure it according to the requirements of your own project, as listed below in HB Very detailed.
4. Next, you can connect the mobile phone to the computer with a USB cable for real machine debugging. (It must be connected through a USB cable. HB does not support wireless connection.) Needless to say, Windows computers can be solved by using some 360 assistants or something. If your phone is Android, it's not that easy on an Apple computer. Later, I also figured it out through Baidu and my own exploration. The method is to download the Android File Transfer software on your Apple computer. When you want to charge, just click on the trial. You need to turn on USB debugging on the phone, and then select Internal CD to connect to the Apple computer. The phone itself also has a prompt (which is really heart-warming)
After the connection is successful, you can start debugging on the real machine.
Note: Many people on the Internet say that their VUE project opens blank. Remember to change the export path of the bulid module in index.js under the config. Because the content in index.html is introduced through script tags, and your path is wrong, it will definitely be blank when opened. Let’s take a look at the default path first.
module.exports = { build: { env: require('./prod.env'), index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'static', assetsPublicPath: '/', productionSourceMap: true,
The default assetsPublicPath is ‘/’ which is the root directory. Our index.html and static are in the same directory. So it needs to be changed to ‘./ ‘
There is also one more thing to note. The default mode in the router/index.js routing configuration in src is hash. If you change it to history mode, it will be blank when you open it. So change it to hash or delete the mode configuration directly and make it the default.
// mode: 'history' // 默认hash
5. If there is no problem in the real machine test. Then you can actually package it into an APP.
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
How to solve the problem of blank page when the vue project is packaged
How to solve the routing History under Vue The page is blank after mode packaging
Introduction to first screen optimization of Vue SPA single-page application
The above is the detailed content of Introduction to Vue webapp project packaging native APP through HBulider. For more information, please follow other related articles on the PHP Chinese website!

vue中props可以传递函数;vue中可以将字符串、数组、数字和对象作为props传递,props主要用于组件的传值,目的为了接收外面传过来的数据,语法为“export default {methods: {myFunction() {// ...}}};”。

本篇文章带大家聊聊vue指令中的修饰符,对比一下vue中的指令修饰符和dom事件中的event对象,介绍一下常用的事件修饰符,希望对大家有所帮助!

如何覆盖组件库样式?下面本篇文章给大家介绍一下React和Vue项目中优雅地覆盖组件库样式的方法,希望对大家有所帮助!

react与vue的虚拟dom没有区别;react和vue的虚拟dom都是用js对象来模拟真实DOM,用虚拟DOM的diff来最小化更新真实DOM,可以减小不必要的性能损耗,按颗粒度分为不同的类型比较同层级dom节点,进行增、删、移的操作。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
