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

如何给侧边栏的某一个菜单添加el-badge #3371

Open
cuihao13453 opened this issue Aug 8, 2020 · 2 comments
Open

如何给侧边栏的某一个菜单添加el-badge #3371

cuihao13453 opened this issue Aug 8, 2020 · 2 comments

Comments

@cuihao13453
Copy link

cuihao13453 commented Aug 8, 2020

Question(提问)

今天遇到一个需求,需要给侧边栏的某一个菜单单独添加一个标记,作为一个菜鸟,不知道应该怎么做,我自己的想法是在layout的sidebar下面的item.vue中添加一个render函数来插入,我写了一点点,完全不明白render怎么搞

@cuihao13453 cuihao13453 changed the title 如何给侧边栏的某一个菜单添加el-badge,但是不知道应该怎么做 如何给侧边栏的某一个菜单添加el-badge Aug 8, 2020
@mayunhai
Copy link
Contributor

直接改模板不好么

@skybocai
Copy link

skybocai commented Sep 8, 2020

首先我在路由中meta,增加了badge参数,想对这个参数进行传值,按照icon的代码逻辑,我在item.vue中增加了vnodes.push() ,并在接受传值props 中增加 badge,菜单栏没有显示我路由中传递的值,当我在props中设置默认值时,页面显示所有侧边菜单都显示了badge,我目前还在研究为什么,希望我的方案能给你一点思路,共同学习

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

3 participants