fix: expose focus function for BaseButton
This fixes an issue with the usage of BaseButton in multiselect.
This commit is contained in:
parent
ab7bf7d8f9
commit
cc079336a8
1 changed files with 10 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
:class="{ 'base-button--type-button': isButton }"
|
||||
v-bind="elementBindings"
|
||||
:disabled="disabled || undefined"
|
||||
ref="button"
|
||||
>
|
||||
<slot />
|
||||
</component>
|
||||
|
@ -89,6 +90,15 @@ watchEffect(() => {
|
|||
})
|
||||
|
||||
const isButton = computed(() => componentNodeName.value === 'button')
|
||||
|
||||
const button = ref()
|
||||
function focus() {
|
||||
button.value.focus()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
focus,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
Loading…
Reference in a new issue