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

click event on MenuItem #2551

Closed
vinicius73 opened this issue Jan 20, 2017 · 1 comment
Closed

click event on MenuItem #2551

vinicius73 opened this issue Jan 20, 2017 · 1 comment

Comments

@vinicius73
Copy link
Contributor

vinicius73 commented Jan 20, 2017

It will be simpler if each menu item triggers an event itself.

<el-menu-item
    v-for="item in items" 
    @click="onMyItemIsClicked(item)" >
  {{ item.name }}
</el-menu-item> 

I have a PR ready for this question, but I would like to know what the team thinks about it.

handleClick: function handleClick() {
    this.dispatch('ElMenu', 'item-click', this);
    this.$emit('click', this);
}
@vinicius73 vinicius73 changed the title Clique no MenuItem click event on MenuItem Jan 20, 2017
@Leopoldthecoder
Copy link
Contributor

Makes sense to me. @baiyaaaaa could you take a look?

@vinicius73 vinicius73 mentioned this issue Jan 27, 2017
3 tasks
baiyaaaaa pushed a commit that referenced this issue Feb 4, 2017
* add click event

* update doc

* add tests
shangkai added a commit to shangkai/element that referenced this issue Feb 8, 2017
* commit 'f72cd1d2ddfb5afc16fc5180358eeabf94e90064': (22 commits)
  Update layout.md
  fix eslint error in gen-single-config.js
  AutoComplete: fix key enter (ElemeFE#2672)
  Example/table: fixed misspelling (ElemeFE#2673)
  Carousel: apply infinite sliding in non-card mode (ElemeFE#2622)
  Dialog: add title slot (ElemeFE#2657)
  update contributing guide (ElemeFE#2653)
  Scrollbar: return if component gets destroyed in mounted hook (ElemeFE#2588)
  Click event ElemeFE#2551 (ElemeFE#2614)
  update index translation (ElemeFE#2601)
  解决error变成null或者空的时候,validateState依然是error的问题。 (ElemeFE#2621)
  Popper: Fixing the rest part of wrong comments. (ElemeFE#2627)
  Update table.md (ElemeFE#2638)
  Added Greek
  Update page.json grammar (ElemeFE#2602)
  Tag: fix a doc issue, fixed ElemeFE#2611 (ElemeFE#2613)
  [tree]:add node-expand and node-collapse event
  [tree]:add node-expand and node-collapse event
  [tree]:add node-expand and node-collapse event
  [tree]:add node-open and node-close event
  ...
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