从观察者调用函数时,发生“ TypeError ...不是函数”的错误

时间:2019-04-12 14:14:00

标签: polymer polymer-2.x

从观察者调用函数时,发生“ TypeError ...不是函数”错误:

selected_project_id : {
              type: Number,
              observer: '_selected_project_idChanged'
},


...
_selected_project_idChanged(selected_project_id) {
                      this.some_function();
}
  

未捕获的TypeError:this.some_function不是HTMLElement上的函数

1 个答案:

答案 0 :(得分:0)

参数的类型应为Object

selected_project_id : {
                  type: Oblect,
                  observer: '_selected_project_idChanged'
    },