【发布时间】:2023-03-17 23:42:01
【问题描述】:
我在我的 Laravel 5.5 和 Vuejs 2 项目中使用 vue-toastr。
祝酒词显示正常,但我想为祝酒词全局设置一些选项,例如位置...
我做不到。
在我的 app.js 文件中,我从 vue-toastr 导入了 toastr,需要样式,然后是 Vue.component('vue-toastr', Toastr);。
我已经在我的 app.js 上尝试了this.$refs.toastr.defaultPosition = "toast-bottom-left",就像文档说的那样,但它给了我一个错误Cannot read property 'toastr' of undefined
有什么帮助吗?
【问题讨论】: