Mojtaba Barari
Mojtaba Barari

Reputation: 1274

Import / export Nuxt layouts

I'm on Nuxtjs 2.15.4 and I wanna import my layouts from different directories. for example

import cms from '~~/mylayout/cms.vue' 
export default{
  layout: cms
}

how can I achieve that?? the important thing is that my layouts be able to import by import function.

I'm doing this for dynamic themes, so that i can read layouts from different directories.

And, how can I change the default layout name?? As I wanna implement dynamic layouts, I probable need to import default layout too. so where I can tell Nuxt that for example ~~/mylayout/d.vue is my default layout?

Upvotes: 0

Views: 818

Answers (1)

kissu
kissu

Reputation: 46726

You don't need to import the layout, it is done for you. Simply put it in the layouts directory.

Upvotes: 1

Related Questions