简体   繁体   English

Vue nuxt js更新代码在npm运行dev时刷新

[英]Vue nuxt js updated code refreshes when npm run dev

I am new to nuxt js.我是 nuxt js 的新手。 I have a template of nuxt js which I am working on.我有一个正在处理的 nuxt js 模板。 In router.js I added some new routes, that's working fine, but when I run my development server again npm run dev , the updated code is just removed.在 router.js 中,我添加了一些新路由,效果很好,但是当我再次运行我的开发服务器npm run dev时,更新的代码就被删除了。 I see the old code there.我在那里看到旧代码。 And it only does for the.nuxt folder.它仅适用于 .nuxt 文件夹。 Not for the vue components.不适用于 vue 组件。

Can anyone suggest something?任何人都可以提出一些建议吗? Thanks.谢谢。

Nuxt uses a method called File system routing , with that routes.js file is automatically generated according to your configuration and pages created, that is why your changes get removed Nuxt 使用一种称为File system routing的方法,该 routes.js 文件会根据您的配置和创建的页面自动生成,这就是您的更改被删除的原因

If you have a specific requirement that need more customization you can extend the router config如果您有需要更多自定义的特定要求,您可以扩展路由器配置

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

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