|
@@ -91,7 +91,7 @@ const props = withDefaults(
|
|
|
{ modal: false, toggleModal: true, score: void 0, scoreValidFail: false }
|
|
|
)
|
|
|
|
|
|
-const emits = defineEmits(['focused', 'toggle-click', 'enter', 'update:score'])
|
|
|
+const emit = defineEmits(['focused', 'blur', 'toggle-click', 'enter', 'update:score'])
|
|
|
|
|
|
const dialogMode = ref<boolean>(props.modal)
|
|
|
|
|
@@ -155,13 +155,14 @@ const onSetScore = (v: number | string) => {
|
|
|
|
|
|
const onInputFocus = () => {
|
|
|
focused.value = true
|
|
|
- emits('focused')
|
|
|
+ emit('focused')
|
|
|
}
|
|
|
|
|
|
const onBlur = (e: Event) => {
|
|
|
focused.value = false
|
|
|
const target = e.target as HTMLInputElement
|
|
|
target.value && scoreStrictValidFail(target.value)
|
|
|
+ emit('blur')
|
|
|
}
|
|
|
|
|
|
const inputFocus = () => {
|
|
@@ -220,7 +221,7 @@ const onValidScore = (e: KeyboardEvent) => {
|
|
|
if ('Enter' === e.key) {
|
|
|
if (oldScore && !scoreStrictValidFail(oldScore)) {
|
|
|
nextTick(() => {
|
|
|
- emits('enter')
|
|
|
+ emit('enter')
|
|
|
})
|
|
|
}
|
|
|
e.preventDefault()
|
|
@@ -255,7 +256,7 @@ const scoreChange = (e: Event) => {
|
|
|
}
|
|
|
|
|
|
const onToggleClick = () => {
|
|
|
- emits('toggle-click')
|
|
|
+ emit('toggle-click')
|
|
|
}
|
|
|
</script>
|
|
|
|