ktquez / vue-extend-layout

Default layout or create custom layouts for the pages of your Vue.js SPA (Multiple layouts)
https://vue-layouts2.surge.sh/
MIT License
131 stars 16 forks source link

File not found layout-components-xxx-vue.js #30

Closed fairking closed 5 years ago

fairking commented 5 years ago

I have the following js errors in my browser: File not found: /layout-components-AppEventbar-vue.4dd61a39707f32e43959.hot-update.js in the html source I can see the following lines: <link href="/layout-components-AppEventbar-vue.4dd61a39707f32e43959.hot-update.js" rel="prefetch"><link href="/layout-components-AppEventbar-vue.js" rel="prefetch"><link href="/layout-components-AppFooter-vue.js" rel="prefetch">...

Should I worry about those errors? Is the any way to supress them?

Please let me know if you need my code examples but as far the code is mostly same as your examples. Thanks.

fairking commented 5 years ago

Not sure if I fixed the issue but errors disappeared since I corrected layout names:

File: /layouts/layout-auth.vue

<script lang="ts">
export default { name: "auth" };
</script>

File: /layouts/layout-loading.vue

<script lang="ts">
export default { name: "loading" };
</script>

File: /layouts/layout-default.vue

<script lang="ts">
export default { name: "default" };
</script>

File: App.vue

<template>
  <div id="app">
    <vue-extend-layouts path="layouts" loading="loading" prefix="layout-" />
  </div>
</template>

File: /modules/LayoutsModule.ts

const state = {
    layout: "loading"
};
const getters = {
    layout(state) {
        return state.layout;
    }
};
const mutations = {
    SET_LAYOUT(state, payload) {
        state.layout = payload;
    }
};
export const layouts = {
    namespaced: true,
    state,
    getters,
    mutations
};
ktquez commented 5 years ago

Yes @denis-pujdak-adm-it

Vue-extend-layout uses the name of the layout to decide which component (layout) to load

fairking commented 5 years ago

Thanks Alan.

ktquez commented 5 years ago

Thanks for using

fairking commented 5 years ago

Thanks for making a great stuff Alan.