Existing Component
是
Component Name
ELSelect
Description
Hope to put the closed event on the icon on the right,I tried to rewrite the display switching method, but I don’t know if it’s right。
const toggleMenu = function({ target }) {
const $arrowEL = target.className.includes('arrow')
if (this.query && this.visible && !$arrowEL) return
if (!this.selectDisabled) {
if (this.menuVisibleOnFocus) {
this.menuVisibleOnFocus = false
if ($arrowEL) {
this.visible = !this.visible
}
} else {
this.visible = !this.visible
}
if (this.visible) {
(this.$refs.input || this.$refs.reference).focus()
}
}
}
2条答案
按热度按时间6ie5vjzr1#
Translation of this issue:
Existing Component
yes
Component Name
ELSelect
Description
Hope to put the closed event on the icon on the right,I tried to rewrite the display switching method, but I don’t know if it’s right。
const toggleMenu = function({ target }) {
const $arrowEL = target.className.includes ('arrow')
if ( this.query && this.visible && !$arrowEL) return
if (! this.selectDisabled ) {
if ( this.menuVisibleOnFocus ) {
this.menuVisibleOnFocus = false
if ($arrowEL) {
this.visible = ! this.visible
}
} else {
this.visible = ! this.visible
}
if ( this.visible ) {
(this.$ refs.input || this.$ refs.reference ).focus()
}
}
}
xxe27gdn2#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.