Solve the problem that uniapp icon is not displayed

08-02-2024

The solution for uniapp icon not displaying: firstly, when referencing the component, give an alias to uni-icon, such as "import uniIcons from '@/components/uni-icon'"; then modify the uni-ui component or upgrade it to the latest one. component or upgrade it to the latest one.


QQ截图20240802135247.jpg


The environment of this tutorial: windows 7 system, uni-app2.5.1 version, thinkpad t480 computer.


Recommended (free): uni-app development tutorials


The problem of uni-icon not displaying after upgrading HBuilderX 2.3.0


The H5 platform has a new built-in icon component, when the uni-icon component of uni-ui is used in the project, it will conflict with the naming of the built-in component, resulting in the uni-icon not being displayed for users who upgraded from the old project.


Solution:


When referencing components, give the uni-icon a different name (e.g. import uniIcons from '@/components/uni-icon'), it has been renamed to uni-icons in the new version of uni-ui.


It should be noted that some uni-ui components depend on uni-icons, so you need to modify the component reference, or upgrade the component to the latest one.


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us