chore: optional chaining (#8283)

This commit is contained in:
neverland
2021-03-05 11:05:27 +08:00
committed by GitHub
parent 391ccd4240
commit 09e1eb5a0d
7 changed files with 24 additions and 47 deletions
+3 -12
View File
@@ -283,7 +283,7 @@ export default createComponent({
value = props.formatter(value);
}
if (inputRef.value && value !== inputRef.value.value) {
if (inputRef.value && inputRef.value.value !== value) {
inputRef.value.value = value;
}
@@ -299,17 +299,8 @@ export default createComponent({
}
};
const focus = () => {
if (inputRef.value) {
inputRef.value.focus();
}
};
const blur = () => {
if (inputRef.value) {
inputRef.value.blur();
}
};
const blur = () => inputRef.value?.blur();
const focus = () => inputRef.value?.focus();
const onFocus = (event: Event) => {
state.focused = true;