vue-js-modal
vue-js-modal copied to clipboard
Cannot read properties of undefined (reading '$modal')
Hi there ! I have inexplicable problem.
project: laravel 8 & vue 3 and installed vue-js-modal
yarn add vue-js-modal // installed through this
Problem:
Cannot read properties of undefined (reading '$modal')
import {createApp, inject, ref} from 'vue'
import routes from './routes'
import store from "./store/store";
import VModal from 'vue-js-modal'
const app = createApp(App)
.use(routes)
.use(store)
.use(VModal);
app.config.globalProperties.$modal = VModal; //and I commented this line
app.mount('#app');
Version:
Vue 3
Example & screenshots:
I'm also having this issue
I have this problem too, with Vue3 and Laravel 9
I have same the problem.
Anybody fixed this? I have same problem
try to inject VModal in context nuxt(2).js
export default function (_, inject) { inject("modal", VModal); }
but in context receive this
install: ƒ (e,t)
Facing same issue too when in production mode , btw in development mode modal works Env : vue-js-modal : 2.0.1 nuxt: 2.15.7