Home >Web Front-end >uni-app >What should I do if uniapp img base64 is not displayed?

What should I do if uniapp img base64 is not displayed?

藏色散人
藏色散人Original
2021-01-18 11:45:325762browse

uniapp img base64 is not displayed because the string is too long and a carriage return is added during transmission. The solution is to recalculate the length and modify the content to "this.captcha.replace(/[\r \n]/g, "")..." That's it.

What should I do if uniapp img base64 is not displayed?

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, Dell G3 computer.

Recommended (free): uni-app development tutorial

Specific questions:

uni_app base64 picture display Not displayed?

uni_app The base64 image cannot be displayed, but the src in the image tag actually has a value. I don’t know why?

What should I do if uniapp img base64 is not displayed?

Solution:

This is caused by adding a carriage return in the transmission when the string is too long

computed:{
captchaSrc(){
return this.captcha.replace(/[\r\n]/g, "");
}
},

Just recalculate.

The above is the detailed content of What should I do if uniapp img base64 is not displayed?. 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