'layouts\default.vue will be reset after I restart the nuxt.js server

I'm currently trying to learn vue.js on the nuxtjs server in the localhost:3000.

I have found out a problem that whenever I create a new "xxxx.vue" file in the "pages" directory or restarting the nuxt.js server, the server will generate a new "default.vue" file to replace my old one (in \layouts\default.vue).

How can this problem to be solved? Is there any way to prevent it from generating a new file to replace it? Thanks a lot!



Solution 1:[1]

If you modified the .nuxt\layouts\default.vue, it will reset after the dev server restart. If you want modify the layout, ignore this file, and create (or copy) a layouts\default.vue in your root directory, and modify this file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 László Szabó