Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

菜单图标不正常显示问题 #16

Closed
lushenghen opened this issue Oct 12, 2020 · 1 comment
Closed

菜单图标不正常显示问题 #16

lushenghen opened this issue Oct 12, 2020 · 1 comment

Comments

@lushenghen
Copy link

当我使用默认的设置时,菜单显示为:
2
然后我找到了相关的代码:

<a href="${menu.url!}" target="${menu.target!}">
    ${menu.icon!'<i class="menu-item-icon fa fa-fw"></i>'}<br/>
    ${menu.name!}
</a>

这里我不能理解,我将其改为了NexT主题的菜单栏代码,

<a href="${menu.url!}" rel="section">
	<#if (menu.icon!)!=''>
	  <i class="menu-item-icon fa fa-fw fa-${menu.icon!}"></i> <br />
	</#if>
	${menu.name!}
</a>

就可以正常显示了
1

这个图标是由后台设置的, 外观---菜单---更多选项---图标中所填写的就是这里显示的图标
运用NexT主题 的代码的话,我在 外观---菜单---更多选项---图标填写 home 字段存到数据库中,前端会变成 fa-home ,正常显示图标。
3

如果是Sagiri 主题的话,那我在 外观---菜单---更多选项---图标 应该填写什么呢?

@feiyangbeyond
Copy link
Collaborator

默认的话就是没有图标的,代码中这样写是为了写一个样例。

<a href="${menu.url!}" target="${menu.target!}">
    ${menu.icon!'<i class="menu-item-icon fa fa-fw"></i>'}<br/>
    ${menu.name!}
</a>

如果你要修改的话可以在图标里这样写:

<i class="menu-item-icon fa fa-home"></i>

你给的NexT主题的代码也给我了灵感,我觉得NexT实现方式更好,有能力的话可以改下,提个pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants