fix: expose focus function for BaseButton

This fixes an issue with the usage of BaseButton in multiselect.
This commit is contained in:
kolaente 2022-07-11 17:06:18 +02:00
parent ab7bf7d8f9
commit cc079336a8
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -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">