【问题标题】:How to use Vuesax $vs.loading outside of component如何在组件之外使用 Vuesax $vs.loading
【发布时间】:2020-08-22 20:11:58
【问题描述】:

有没有办法在路由器(router.js)文件中使用Vuesax $vs.loading?当我尝试 $vs.loading 失败并出现未定义的错误时,也尝试了 Vue.prototype.$vs.loading 但仍然没有运气。

【问题讨论】:

    标签: vue.js vuejs2 vue-component vuex vue-router


    【解决方案1】:

    虽然不漂亮,但您可以在实例化 Vue 实例后将 $vs 对象添加回原型。

    Vue.prototype.$vs = this.$vs;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-09
      • 1970-01-01
      • 1970-01-01
      • 2020-12-27
      • 2020-08-25
      • 1970-01-01
      • 2018-12-02
      • 2021-04-17
      相关资源
      最近更新 更多