lepikhinb / momentum-layout

MIT License
31 stars 1 forks source link

'defineLayout' is not defined error #1

Open bojmaliev opened 1 year ago

bojmaliev commented 1 year ago

I'm using this package in my Laravel 10, Vue 3, Inertia 1 project but I'm getting 'defineLayout' is not defined

This is my vite.config.js file:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
import eslintPlugin from 'vite-plugin-eslint';
import inertiaLayout from "momentum-layout"
export default defineConfig({
    plugins: [
        laravel({
            input: 'resources/js/app.js',
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
        inertiaLayout(),
        eslintPlugin(),
    ],
});

and this is the way I'm using the package:

<template>
    <div></div>
</template>

<script setup>
import DefaultLayout from "@/Layouts/DefaultLayout.vue";
defineLayout(DefaultLayout)

</script>

<style scoped></style>
bojmaliev commented 1 year ago

It's more eslint issue, I deleted eslint. I don't really know how to "tell" it to understand the Vite macro.