代码之家  ›  专栏  ›  技术社区  ›  Jayesh Dhandha

类型错误:无法读取q-ajax-bar中未定义的属性“$on”

  •  1
  • Jayesh Dhandha  · 技术社区  · 6 年前

    类星体:V0.172

    节点:V7.4.0

    NPM:5.6

    我正在使用开始/停止事件操作Ajax栏。在呈现app.vue时出现以下错误。

    挂接中出错:typeerror:无法读取的属性$on 未定义

    模板:

    <q-ajax-bar ref="loadingBar" :delay="delay" :speed="speed" :color="color" />
    

    脚本:

    this.$refs.loadingBar.$on('stop', () => {
          console.log("ajax-bar stop");
        });
    this.$refs.loadingBar.$on('start', () => {
           console.log("ajax-bar start");
          }
        });
    

    有什么帮助吗? 谢谢!

    1 回复  |  直到 6 年前
        1
  •  1
  •   devic code    6 年前

    尝试使用@start和@stop。

    希望这有帮助!