element-plus [Component] [date-picker] Datepicker Shortcuts onClick not working

slwdgvem  于 5个月前  发布在  其他
关注(0)|答案(3)|浏览(46)

Bug Type: Component

Environment

  • Vue Version: 3.2.45
  • Element Plus Version: 2.3.1
  • Browser / OS: chrome
  • Build Tool: Vite

Reproduction

  • el-date-picker

Element Plus Playground

Steps to reproduce

I have attach the link of playground.
You can reproduce by adding shortcuts and in shortcuts you can add onClick function

What is Expected?

When you click on shortcuts it's click should work

What is actually happening?

click is not triggering

Additional comments

(empty)

htzpubme

htzpubme1#

There are currently no emit events thrown by clicking the shortcuts.

But the onClick will trigger when the value is undefined. I do not know if this can meet your needs.

disho6za

disho6za2#

I found that the onClick attribute is not present in the document, and it is indeed included in the source code.

However, according to the currently declared ts type, it should not trigger.

I think it's redundant code.

Why is this attribute needed?

2nbm6dog

2nbm6dog3#

@tolking I need this attribute to know which preset I clicked and need to store the preset, Maybe is there any method but I did not find any other method. If is there any method to get this it will help.

相关问题