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 }"
|
:class="{ 'base-button--type-button': isButton }"
|
||||||
v-bind="elementBindings"
|
v-bind="elementBindings"
|
||||||
:disabled="disabled || undefined"
|
:disabled="disabled || undefined"
|
||||||
|
ref="button"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</component>
|
</component>
|
||||||
|
@ -89,6 +90,15 @@ watchEffect(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const isButton = computed(() => componentNodeName.value === 'button')
|
const isButton = computed(() => componentNodeName.value === 'button')
|
||||||
|
|
||||||
|
const button = ref()
|
||||||
|
function focus() {
|
||||||
|
button.value.focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
focus,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
Loading…
Reference in a new issue