Skip to content

Commit fc4b6d5

Browse files
author
Tenny
committed
fix(MdInput): 增加 focus、blur 事件
1 parent 135c28c commit fc4b6d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/input/MdInput.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { random, isBlank } from 'ph-utils';
3131
const el = ref<HTMLInputElement>();
3232
3333
const modelValue = defineModel<string | number>();
34+
const emits = defineEmits(['focus', 'blur']);
3435
3536
const focused = ref(false);
3637
@@ -63,10 +64,12 @@ function focus() {
6364
6465
function handleInputFocus() {
6566
focused.value = true;
67+
emits('focus');
6668
}
6769
6870
function handleInputBlur() {
6971
focused.value = false;
72+
emits('blur');
7073
}
7174
7275
const hasValue = computed(() => {

0 commit comments

Comments
 (0)