Skip to content

Commit

Permalink
Feature menu click (#3228)
Browse files Browse the repository at this point in the history
* fix: 修复DatePicker的prefixIcon未传递时仍透传了prefixIcon函数导致产生非预期渲染

* feat: menu onClick事件增加value参数
  • Loading branch information
dexterBo authored Aug 15, 2023
1 parent 330ebc8 commit c22ae30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/menu/menu-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default defineComponent({
e.stopPropagation();
if (this.disabled) return;
this.menu.select(this.value);
emitEvent(this, 'click', { e });
emitEvent(this, 'click', { e, value: this.value });
if (this.to || (this.routerLink && this.href)) {
const router = this.router || this.$router;
const methods: string = this.replace ? 'replace' : 'push';
Expand Down
2 changes: 1 addition & 1 deletion src/menu/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export interface TdMenuItemProps {
/**
* 点击时触发
*/
onClick?: (context: { e: MouseEvent }) => void;
onClick?: (context: { e: MouseEvent; value: MenuValue }) => void;
}

export interface TdMenuGroupProps {
Expand Down

0 comments on commit c22ae30

Please sign in to comment.