I'm having a great deal of trouble with my Vue component.
<script lang="ts">
import Vue from 'vue';
import { ElForm } from 'element-ui/types/form';
type Validator = (
this: typeof PasswordReset,
rule: any,
value: any,
callback: (error?: Error) => void
) => void;
const validatePass1: Validator = function(rule, value, callback) {
if (value && this.form.passwordConfirm) {
(this.$refs.form as ElForm).validateField('passwordConfirm', valid => {});
}
};
const PasswordReset = Vue.extend({
// ...
In the validatePass1 func, this.form is underlined as an error, as is this.$refs. Respectively:
"Property 'form' does not exist on type 'VueConstructor<{ form: { password: string; passwordConfirm: string; }; rules: { password: ({ requ...'."
"Property '$refs' does not exist on type 'VueConstructor<{ form: { password: string; passwordConfirm: string; }; rules: { password: ({ requ...'."
How do I get this function to recognize refs/props/data attached to my component?