0

I upgrading my Vue 2 project to Vue 3 (BootstrapVue (2.23.1) with @vue/compat). I facing serval problem. The first problem is how to get $bvModal in setup?

Anybody known?

Eagle
  • 451
  • 2
  • 5
  • 14
  • Does this answer your question? [Add global variable in Vue.js 3](https://stackoverflow.com/questions/63100658/add-global-variable-in-vue-js-3) – Duannx Dec 20 '22 at 02:11
  • Thank you for reply, this link cannot help to me :( – Eagle Dec 20 '22 at 02:57

1 Answers1

0
import {BootstrapVue, BModal } from 'bootstrap-vue'import { createApp } from '@vue/compat' //In setup> const { BModal } = inject('BModal') //use> const $bvModal = new BModal({ ref: 'modal'})
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
  • Actually, I need use $bvModal to use $bvModal.msgBoxConfirm but your answer cannot. – Eagle Dec 20 '22 at 03:20
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Jeremy Caney Dec 24 '22 at 01:40