Javascript TypeError此错误。$refs.password在Vue JS中未定义

Javascript TypeError此错误。$refs.password在Vue JS中未定义,javascript,vue.js,Javascript,Vue.js,我前面有个错误。我尝试将length的errorBucket用于v-progress-linear(Vuetify)() 模板 <v-form ref="form" v-model="valid" lazy-validation

我前面有个错误。我尝试将length的errorBucket用于v-progress-linear(Vuetify)()

模板

                    <v-form
                        ref="form"
                        v-model="valid"
                        lazy-validation
                    >
                    ...
                                <v-text-field
                                    ref="password"
                                    :rules="[rules.required, rules.min, rules.space, nom, prenom, rules.contain]"
                                    counter
                                    loading
                                >
                                    <template v-slot:progress>
                                        <v-progress-linear
                                            v-if="custom"
                                            :value="progress"
                                            :color="color"
                                        ></v-progress-linear>
                                    </template>
                                </v-text-field>
                    </v-form>
打开模式时出错

[Vue warn]: Error in render: "TypeError: this.$refs.password is undefined"
TypeError: this.$refs.password is undefined
[Vue warn]: Error in mounted hook: "TypeError: IntersectionObserver.observe: Argument 1 does not implement interface Element."
TypeError: IntersectionObserver.observe: Argument 1 does not implement interface Element.

如果有人有解决方案,我会提前感谢您。

按照以下方式重构您的计算机:

progress() {
  this.$nextTick(() => {
    // your code goes here
  });
}

通过将您的代码包装在
this.$nextTick
中,您可以确保代码在呈现所有内容时运行,并且您已经完成了对模板中定义的
ref
的访问。

您在何处将
密码定义为
ref
?@hamidniakan i update my post$refs不是被动的,不应在中使用计算。即使绕过TypeError,函数也不会work@Sølvetraftøe您知道如何从规则中访问错误数吗?
progress() {
  this.$nextTick(() => {
    // your code goes here
  });
}