search
HomeWeb Front-enduni-appHow to solve the problem that the page will not render after uniapp is packaged

Uniapp will not render the page after being packaged because vue two-way binding is invalid. The solution is: first open the corresponding code file; then use "this.$forceUpdate" to force refresh the data.

How to solve the problem that the page will not render after uniapp is packaged

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version. This method is suitable for all brands of computers.

Recommended (free): uni-app development tutorial

Specific questions:

onShow event data after uniapp packages the APP The data is refreshed but the page is not rendered.

When the "My" page is not logged in, the nickname displays "Please log in", then click "Please log in" to jump to the login page. After successful login, the user is cached through uni.setStorage data The nickname is saved to the cache, and then returned to the "My" page. It is found that the nickname data data has changed to the user nickname in the cache, but the content of the text tag bound to the nickname data on the page has not changed. It is still "Please log in".. .

This is my text binding data code

How to solve the problem that the page will not render after uniapp is packaged

After successful login, retrieve the nickname from the cache and assign a value to the data

How to solve the problem that the page will not render after uniapp is packaged

Before logging in, because the nickname is "", it will display Please log in

How to solve the problem that the page will not render after uniapp is packaged

After successful login, the value of nickname will be retrieved from the cache, so the nickname will be The location will change

How to solve the problem that the page will not render after uniapp is packaged

The browser side works normally, but after packaging it into an APP, the "Please log in" remains unchanged, but the value of the nickname does change. I tried to retrieve it from the document. The id assignment doesn't work, and the jQuery id assignment doesn't work either. I don't know if it's a problem with Android. My Android version is 10

Solution:

The reason is because vue is bound in two directions Definitely invalid, use this.$forceUpdate to force refresh the data!

The above is the detailed content of How to solve the problem that the page will not render after uniapp is packaged. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

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),

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!