update 22
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<button
|
||||
ref="buttonRef"
|
||||
:type="type"
|
||||
:class="['btn', `btn-${variant}`, { 'btn-sm': size === 'sm', 'btn-lg': size === 'lg' }]"
|
||||
:disabled="disabled || loading"
|
||||
@@ -11,7 +12,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({
|
||||
import { ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
default: 'button'
|
||||
@@ -31,6 +34,14 @@ defineProps({
|
||||
})
|
||||
|
||||
defineEmits(['click'])
|
||||
|
||||
const buttonRef = ref(null)
|
||||
|
||||
const focus = () => {
|
||||
buttonRef.value?.focus()
|
||||
}
|
||||
|
||||
defineExpose({ focus })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user