feat: Replace this.$refs.refName as Vue with InstanceType<T> (no-changelog) (#6050)
* refactor: use InstanceType<T> for all this.$refs types * refactor: update refs type in N8nSelect * fix: remove inputRef non-null assertion Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * fix: remove non-null assertion --------- Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
This commit is contained in:
@@ -92,6 +92,8 @@ import { useSegment } from '@/stores/segment';
|
||||
import { externalHooks } from '@/mixins/externalHooks';
|
||||
import { getMappedResult } from '../utils/mappingUtils';
|
||||
|
||||
type ParamterInputWrapperRef = InstanceType<typeof ParameterInputWrapper>;
|
||||
|
||||
const DISPLAY_MODES_WITH_DATA_MAPPING = ['table', 'json', 'schema'];
|
||||
|
||||
export default mixins(showMessage, externalHooks).extend({
|
||||
@@ -219,18 +221,17 @@ export default mixins(showMessage, externalHooks).extend({
|
||||
this.menuExpanded = expanded;
|
||||
},
|
||||
optionSelected(command: string) {
|
||||
if (this.$refs.param) {
|
||||
(this.$refs.param as Vue).$emit('optionSelected', command);
|
||||
}
|
||||
const paramRef = this.$refs.param as ParamterInputWrapperRef | undefined;
|
||||
paramRef?.$emit('optionSelected', command);
|
||||
},
|
||||
valueChanged(parameterData: IUpdateInformation) {
|
||||
this.$emit('valueChanged', parameterData);
|
||||
},
|
||||
onTextInput(parameterData: IUpdateInformation) {
|
||||
const param = this.$refs.param as Vue | undefined;
|
||||
const paramRef = this.$refs.param as ParamterInputWrapperRef | undefined;
|
||||
|
||||
if (isValueExpression(this.parameter, parameterData.value)) {
|
||||
param?.$emit('optionSelected', 'addExpression');
|
||||
paramRef?.$emit('optionSelected', 'addExpression');
|
||||
}
|
||||
},
|
||||
onDrop(newParamValue: string) {
|
||||
|
||||
Reference in New Issue
Block a user