Skip to content

Simple Import in app.js not working Vue3 /Inertia #41

Description

@Sublan

import Toaster from "@meforma/vue-toaster";
createInertiaApp({
title: (title) => ${title} - ${appName},
resolve: (name) => resolvePageComponent(./Pages/${name}.vue, import.meta.glob('./Pages/**/*.vue')),
setup({ el, App, props, plugin }) {
return createApp({ render: () => h(App, props) })
.use(plugin)
.use(Toaster)
.use(ZiggyVue)
.mount(el);
},

Vue File :
Tried
toast.show(Hey! I'm here);
this.$toast.show(Hey! I'm here);
Error : toast is not defined

Import inside vue file works fine , import from app.js not working // Laravel , Vue3 , InertiaJs , ViteJs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions