Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Defining a global component in svelte in Inertia.js as in vue.js

$
0
0
import { createApp, h } from 'vue';import {createInertiaApp, Link} from '@inertiajs/inertia-vue3';import { InertiaProgress } from '@inertiajs/progress'createInertiaApp({    resolve: name => {        const pages = import.meta.glob('./Pages/**/*.vue', { eager: true })        return pages[`./Pages/${name}.vue`]    },    setup({ el, App, props, plugin }) {        createApp({ render: () => h(App, props) })            .use(plugin)            .component("Link", Link)            .mount(el)    },});

Can we create this kind of structure in Svelte, like in Vue.js?

I want to use the component only by defining it in the main js file and calling it wherever I want without calling it over and over again


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>