Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page loads even if layout has no slot #235

Open
envatic opened this issue Apr 4, 2022 · 1 comment
Open

Page loads even if layout has no slot #235

envatic opened this issue Apr 4, 2022 · 1 comment

Comments

@envatic
Copy link

envatic commented Apr 4, 2022

resolve: (name) =>{ 
		const page = require(`./Pages/${name}.vue`);
		page.layout = Layout
		return page;
	},

Layout component has no slot, but the page loads all the same,
Basically I cant control when to hide page in the layout.

@envatic envatic changed the title Page loads evenif layout has no slot Page loads even if layout has no slot Apr 4, 2022
@Tofandel
Copy link

Tofandel commented May 9, 2022

That's because you're modifying layout on a promise, so technically your layout is not working in the first place, nothing to do with slots.

Also this is not the right repo for this issue

This is how I do it

  resolve: async (name) => {
    const { default: cmp } = await import(
      /* webpackExclude: /(\/Partials\/)/ */
      /* webpackChunkName: 'page-[request]' */
      `./Pages/${name}.vue`);
      cmp.layout = Layout;
      return cmp;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant