Mixin functions (i.e. $bvToast, $bvModal) do not work on Vue 3
Author: MorgulCreated Jan 18, 2023Updated Apr 13, 2025
Describe the bug
When running with @vue/compat in { MODE: 2 }, it appears that any functions added to Vue instance by a mixin are not available. This includes $bvToast and $bvModal.
Steps to reproduce the bug
- Run in Vue 3 mode with
@vue/compat. - Inside of a component, attempt to access
this.$bvToast. - It does not exist.
Expected behavior
When running with Vue 3, these functions should appear. (It's particularly bad for $bvToast, as there's no other way to dynamically create toasts.)
Versions
Libraries:
- BootstrapVue: 2.23.1
- Bootstrap: 4.6.1
- Vue: 3.2.45
- Vue Compat: 3.2.45
Environment:
- All
Additional context
I'm attempting to upgrade my application to Vue 3 (as an exploratory exercise) and I cannot, for the life of me work out how to use functions added by mixins. Without that, I can't convert the parts of my application that use toasts; they're just broken.
Source: bootstrap-vue/bootstrap-vue