简体   繁体   English

layouts\default.vue 会在我重启 nuxt.js 服务器后重置

[英]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.我目前正在尝试在 localhost:3000 的 nuxtjs 服务器上学习 vue.js。

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) .我发现一个问题,每当我在“页面”目录中创建一个新的“xxxx.vue”文件或重新启动nuxt.js服务器时,服务器将生成一个新的“default.vue”文件来替换我的旧文件(在\布局\默认.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!非常感谢!

If you modified the .nuxt\layouts\default.vue , it will reset after the dev server restart.如果您修改了.nuxt\layouts\default.vue ,它将在开发服务器重启后重置。 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.如果你想修改布局,忽略这个文件,在你的根目录下创建(或复制)一个layouts\default.vue ,修改这个文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM