types: improve ref typing (#8182)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { PropType, ref } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { createNamespace } from '../utils';
|
||||
import { ComponentInstance, createNamespace } from '../utils';
|
||||
import { isAndroid } from '../utils/validate/system';
|
||||
|
||||
// Components
|
||||
@@ -31,7 +31,7 @@ export default createComponent({
|
||||
emits: ['blur', 'focus', 'input', 'select-search'],
|
||||
|
||||
setup(props, { emit }) {
|
||||
const field = ref();
|
||||
const field = ref<ComponentInstance>();
|
||||
|
||||
const showSearchResult = () =>
|
||||
props.focused && props.searchResult && props.showSearchResult;
|
||||
@@ -42,7 +42,7 @@ export default createComponent({
|
||||
};
|
||||
|
||||
const onFinish = () => {
|
||||
field.value.blur();
|
||||
field.value!.blur();
|
||||
};
|
||||
|
||||
const renderFinish = () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ref, watch, computed, nextTick, reactive, PropType } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { createNamespace, isObject } from '../utils';
|
||||
import { ComponentInstance, createNamespace, isObject } from '../utils';
|
||||
import { isMobile } from '../utils/validate/mobile';
|
||||
|
||||
// Composition
|
||||
@@ -113,7 +113,7 @@ export default createComponent({
|
||||
],
|
||||
|
||||
setup(props, { emit, slots }) {
|
||||
const areaRef = ref();
|
||||
const areaRef = ref<ComponentInstance>();
|
||||
|
||||
const state = reactive({
|
||||
data: {} as AddressInfo,
|
||||
|
||||
Reference in New Issue
Block a user