Adi*_*ya 6 javascript firebase vue.js vuetify.js
当读取数据从Firebase
我尝试设置properties
了中object
获得的UI,但是当我尝试设置任何更改的数据,它将引发我这个错误。
v-on 处理程序中的错误:“类型错误:无法使用‘in’运算符在空值中搜索‘cc’。
我在开发模式下使用 Vue 以及Firebase
. 有什么我遗漏的概念吗?
beforeCreate(){
sref.get().then(sc => {
if (sc.exists) {
console.log(sc.data()); //this logs in the correct data
this.school = sc.data(); //this too
this.cc = sc.data().cc; //also this
this.name = sc.data().name;
Run Code Online (Sandbox Code Playgroud)
当我做
console.log(this.name)
Run Code Online (Sandbox Code Playgroud)
在created()
它显示未定义时,任何更改或更新的尝试也会出错
Vue warn]: Cannot set reactive property on undefined, null, or primitive value: null
[Vue warn]: Error in v-on handler: "TypeError: Cannot use 'in' operator to search for 'cc' in null"
found in
---> <VSelect>
<VForm>
<VCard>
TypeError: Cannot use 'in' operator to search for 'cc' in null
at Proxy.set
Run Code Online (Sandbox Code Playgroud)
Adi*_*ya 8
我找出了哪里出错了,在我的模板中v-model
我使用了this.school
, this.name
,this.cc
这导致了警告的出现,但我仍然不清楚工作的内部结构。我想如果有人向我指出正确的资源。
归档时间: |
|
查看次数: |
13625 次 |
最近记录: |