protonemedia / inertia-vue-modal-poc

Proof of Concept: Load any route into a modal with Inertia.js
https://protone.media/en/blog/proof-of-concept-load-any-route-into-a-modal-with-inertiajs-using-laravel-and-vuejs
MIT License
51 stars 9 forks source link

Vue 3? #1

Open Kirack37 opened 3 years ago

Kirack37 commented 3 years ago

I'm having a problem using this in Vue 3. I import like this in my app.js:

import { createApp, h } from 'vue';
import { App as InertiaApp, plugin as InertiaPlugin } from '@inertiajs/inertia-vue3';
import { InertiaProgress } from '@inertiajs/progress';

import VueFinalModal from 'vue-final-modal'
import PortalVue from "portal-vue";
import { Modalable, ToModal } from "@protonemedia/inertia-vue-modal-poc"

const el = document.getElementById('app');

createApp({
        render: () =>
            h(InertiaApp, {
                initialPage: JSON.parse(el.dataset.page),
                resolveComponent: (name) => require(`./Pages/${name}`).default,
            }),
    })
    .mixin({ methods: { route } })

    .use(InertiaPlugin)
    .component("Modalable", Modalable)
    .component("ToModal", ToModal)
    .use(PortalVue)
    .use(VueFinalModal())
    .mount(el);

But I'm having this problem: export 'ToModal' (imported as 'ToModal') was not found in '@protonemedia/inertia-vue-modal-poc' (module has no exports)

Tofandel commented 2 years ago

I made a vue3 fork https://github.com/Tofandel/inertia-vue3-modal